diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000..891bb15b --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,155 @@ +name: .NET + +on: [push, pull_request] + +jobs: + + # Build the ComputeSharp project directly. This is the project that + # would be built when running any of the local samples or unit tests. + build-project: + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + - name: Create local NuGet feed + run: mkdir src\ComputeSharp.Package\bin\Release + shell: cmd + - name: Build + run: dotnet build src\ComputeSharp\ComputeSharp.csproj -c Release + shell: cmd + + # Run all the unit tests referencing the ComputeSharp project directly. + run-tests: + if: success() + needs: [build-project] + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + - name: Create local NuGet feed + run: mkdir src\ComputeSharp.Package\bin\Release + shell: cmd + - name: Run ComputeSharp.Tests + run: dotnet test tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj -v n -l "console;verbosity=detailed" + shell: cmd + - name: Run ComputeSharp.Tests.Internals + run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -v n -l "console;verbosity=detailed" + shell: cmd + - name: Run ComputeSharp.Tests.Internals.SourceGenerators + run: dotnet test tests\ComputeSharp.Tests.Internals.SourceGenerators\ComputeSharp.Tests.Internals.SourceGenerators.csproj -v n -l "console;verbosity=detailed" + shell: cmd + + # Run all the local samples to ensure they build and run with no errors. + run-samples: + if: success() + needs: [run-tests] + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + - name: Create local NuGet feed + run: mkdir src\ComputeSharp.Package\bin\Release + shell: cmd + - name: Build ComputeSharp.Sample.Local + run: dotnet build samples\ComputeSharp.Sample.Local\ComputeSharp.Sample.Local.csproj -c Release + shell: cmd + - name: Run ComputeSharp.Sample.Local + run: dotnet samples\ComputeSharp.Sample.Local\bin\Release\net5.0\ComputeSharp.Sample.Local.dll + shell: cmd + - name: Build ComputeSharp.ImageProcessing.csproj + run: dotnet build samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj -c Release + shell: cmd + - name: Run ComputeSharp.ImageProcessing.csproj + run: dotnet samples\ComputeSharp.ImageProcessing\bin\Release\net5.0\ComputeSharp.ImageProcessing.dll + shell: cmd + - name: Build ComputeSharp.Benchmark.csproj + run: dotnet build samples\ComputeSharp.Benchmark\ComputeSharp.Benchmark.csproj -c Release + shell: cmd + - name: Build ComputeSharp.SwapChain.csproj + run: dotnet build samples\ComputeSharp.SwapChain\ComputeSharp.SwapChain.csproj -c Release + shell: cmd + + # Buils the .msbuildproj project to generate the NuGet package. + # This workflow also uploads the resulting package as an artifact. + build-package: + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + - name: Create local NuGet feed + run: mkdir src\ComputeSharp.Package\bin\Release + shell: cmd + - name: Build + run: dotnet build src\ComputeSharp.Package\ComputeSharp.Package.msbuildproj -c Release + shell: cmd + - name: Upload package artifact + uses: actions/upload-artifact@v2 + with: + name: ComputeSharp.nupkg + path: src\ComputeSharp.Package\bin\Release\*.nupkg + + # Download the NuGet package generated in the previous job and use it + # to build and run the sample project referencing it. This is used as + # a test to ensure the NuGet package works in a consuming project. + verify-package: + if: success() + needs: [build-package] + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + - name: Create local NuGet feed + run: mkdir src\ComputeSharp.Package\bin\Release + shell: cmd + - name: Download package artifact + uses: actions/download-artifact@v2 + with: + name: ComputeSharp.nupkg + path: src\ComputeSharp.Package\bin\Release\ComputeSharp.nupkg + - name: Build ComputeSharp.Sample.NuGet + run: dotnet build samples\ComputeSharp.Sample.NuGet\ComputeSharp.Sample.NuGet.csproj -c Release + shell: cmd + - name: Run ComputeSharp.Sample.NuGet + run: dotnet samples\ComputeSharp.Sample.NuGet\bin\Release\net5.0\ComputeSharp.Sample.NuGet.dll + shell: cmd + + # Run the extra tests to validate a number of build and publishing configurations. + # This is used to ensure the native dependencies can always be loaded correctly + # regardless of whether the app is shipping with R2R, self-contained, etc. + verify-libs: + if: success() + needs: [verify-package] + runs-on: windows-latest + steps: + - name: Git checkout + uses: actions/checkout@v2 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 5.0.x + - name: Create local NuGet feed + run: mkdir src\ComputeSharp.Package\bin\Release + shell: cmd + - name: Run ComputeSharp.Tests.NativeLibrariesResolver + run: dotnet test tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj -v n -l "console;verbosity=detailed" + shell: cmd \ No newline at end of file diff --git a/.gitignore b/.gitignore index 23c39fe0..0d7a3e0d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,9 @@ bld/ [Oo]bj/ [Ll]og/ +# Debug view types +!**/Resources/Debug + # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot @@ -329,6 +332,8 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ -# Sample bokeh blur image -**/*_bokeh.jpg -**/*_gaussian.jpg +# Sample images +samples/**/city_*.jpg + +# XML docs files +src/**/ComputeSharp*.xml \ No newline at end of file diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 4f97f672..24463506 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -5,20 +5,12 @@ VisualStudioVersion = 16.0.29201.188 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp", "src\ComputeSharp\ComputeSharp.csproj", "{314EB353-E7E3-4146-8111-685CC83EC1DE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Core", "src\ComputeSharp.Core\ComputeSharp.Core.csproj", "{9F9581FB-6EF7-418E-BFA5-0EFED874E980}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Graphics", "src\ComputeSharp.Graphics\ComputeSharp.Graphics.csproj", "{2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Shaders", "src\ComputeSharp.Shaders\ComputeSharp.Shaders.csproj", "{23AE6EED-79CD-4ADD-9A85-0148BD957D19}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Benchmark", "samples\ComputeSharp.Benchmark\ComputeSharp.Benchmark.csproj", "{34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.ImageProcessing", "samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj", "{524CC5DD-1DEE-4A30-9515-AB90965E5207}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample", "samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj", "{7A48A85D-8866-4DED-A404-653ED09BF396}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests", "tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj", "{E91F4D24-922A-4921-A8D7-9C45A143C45D}" @@ -28,11 +20,35 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_SolutionItems", "{1A9C4108-F61A-4ABE-B5CF-F524521EAE2D}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + global.json = global.json LICENSE = LICENSE README.md = README.md EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SourceGenerators", "src\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.csproj", "{EB52CB67-4162-4722-874B-44EA8DA5450E}" +EndProject +Project("{13B669BE-BB05-4DDF-9536-439F39A36129}") = "ComputeSharp.Package", "src\ComputeSharp.Package\ComputeSharp.Package.msbuildproj", "{0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{FB17EF84-9208-47AC-921F-680CB1DAD8BA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample.Local", "samples\ComputeSharp.Sample.Local\ComputeSharp.Sample.Local.csproj", "{7048DEEA-0A6F-46A0-B951-B682A8F1CB75}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample.NuGet", "samples\ComputeSharp.Sample.NuGet\ComputeSharp.Sample.NuGet.csproj", "{C423C061-64F7-4C12-8E5F-75C5351D6308}" +EndProject +Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.Sample.Shared", "samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.shproj", "{8CEFC324-CA6C-4845-9AD9-70B92BD87057}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.Internals.SourceGenerators", "tests\ComputeSharp.Tests.Internals.SourceGenerators\ComputeSharp.Tests.Internals.SourceGenerators.csproj", "{BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.NativeLibrariesResolver", "tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj", "{BF52326F-E415-49E6-8595-62762216762B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain", "samples\ComputeSharp.SwapChain\ComputeSharp.SwapChain.csproj", "{E7C9247D-016B-4819-AF9F-0E9B3591E04B}" +EndProject Global + GlobalSection(SharedMSBuildProjectFiles) = preSolution + samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{7048deea-0a6f-46a0-b951-b682a8f1cb75}*SharedItemsImports = 5 + samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{8cefc324-ca6c-4845-9ad9-70b92bd87057}*SharedItemsImports = 13 + samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{c423c061-64f7-4c12-8e5f-75c5351d6308}*SharedItemsImports = 5 + EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 @@ -48,30 +64,6 @@ Global {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|Any CPU.Build.0 = Release|Any CPU {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.ActiveCfg = Release|Any CPU {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.Build.0 = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|x64.ActiveCfg = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Debug|x64.Build.0 = Debug|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|Any CPU.Build.0 = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|x64.ActiveCfg = Release|Any CPU - {9F9581FB-6EF7-418E-BFA5-0EFED874E980}.Release|x64.Build.0 = Release|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Debug|x64.ActiveCfg = Debug|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Debug|x64.Build.0 = Debug|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Release|Any CPU.Build.0 = Release|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Release|x64.ActiveCfg = Release|Any CPU - {2499CC74-BC9A-4B30-A3B6-05F9C7BF9B34}.Release|x64.Build.0 = Release|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Debug|x64.ActiveCfg = Debug|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Debug|x64.Build.0 = Debug|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Release|Any CPU.Build.0 = Release|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Release|x64.ActiveCfg = Release|Any CPU - {23AE6EED-79CD-4ADD-9A85-0148BD957D19}.Release|x64.Build.0 = Release|Any CPU {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|Any CPU.Build.0 = Debug|Any CPU {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -88,14 +80,6 @@ Global {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|Any CPU.Build.0 = Release|Any CPU {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.ActiveCfg = Release|Any CPU {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.Build.0 = Release|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Debug|x64.Build.0 = Debug|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Release|Any CPU.Build.0 = Release|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Release|x64.ActiveCfg = Release|Any CPU - {7A48A85D-8866-4DED-A404-653ED09BF396}.Release|x64.Build.0 = Release|Any CPU {E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|Any CPU.Build.0 = Debug|Any CPU {E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -112,6 +96,62 @@ Global {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6}.Release|Any CPU.Build.0 = Release|Any CPU {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6}.Release|x64.ActiveCfg = Release|Any CPU {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6}.Release|x64.Build.0 = Release|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Debug|x64.ActiveCfg = Debug|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Debug|x64.Build.0 = Debug|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|Any CPU.Build.0 = Release|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.ActiveCfg = Release|Any CPU + {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.Build.0 = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|x64.ActiveCfg = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Debug|x64.Build.0 = Debug|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|Any CPU.Build.0 = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|x64.ActiveCfg = Release|Any CPU + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3}.Release|x64.Build.0 = Release|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|x64.ActiveCfg = Debug|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|x64.Build.0 = Debug|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|Any CPU.Build.0 = Release|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|x64.ActiveCfg = Release|Any CPU + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|x64.Build.0 = Release|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Debug|x64.ActiveCfg = Debug|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Debug|x64.Build.0 = Debug|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Release|Any CPU.Build.0 = Release|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Release|x64.ActiveCfg = Release|Any CPU + {C423C061-64F7-4C12-8E5F-75C5351D6308}.Release|x64.Build.0 = Release|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|x64.ActiveCfg = Debug|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|x64.Build.0 = Debug|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|Any CPU.Build.0 = Release|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|x64.ActiveCfg = Release|Any CPU + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|x64.Build.0 = Release|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Debug|x64.ActiveCfg = Debug|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Debug|x64.Build.0 = Debug|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Release|Any CPU.Build.0 = Release|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Release|x64.ActiveCfg = Release|Any CPU + {BF52326F-E415-49E6-8595-62762216762B}.Release|x64.Build.0 = Release|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|x64.ActiveCfg = Debug|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|x64.Build.0 = Debug|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|Any CPU.Build.0 = Release|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|x64.ActiveCfg = Release|Any CPU + {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -119,9 +159,15 @@ Global GlobalSection(NestedProjects) = preSolution {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {524CC5DD-1DEE-4A30-9515-AB90965E5207} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {7A48A85D-8866-4DED-A404-653ED09BF396} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {E91F4D24-922A-4921-A8D7-9C45A143C45D} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} + {0A6AE752-2A1D-40F8-B9E7-46B60F5321A3} = {FB17EF84-9208-47AC-921F-680CB1DAD8BA} + {7048DEEA-0A6F-46A0-B951-B682A8F1CB75} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} + {C423C061-64F7-4C12-8E5F-75C5351D6308} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} + {8CEFC324-CA6C-4845-9AD9-70B92BD87057} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} + {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} + {BF52326F-E415-49E6-8595-62762216762B} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} + {E7C9247D-016B-4819-AF9F-0E9B3591E04B} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC} diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..71e2d6cb --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,10 @@ + + + true + 9.0 + enable + true + Sergio Pedri + Copyright (c) 2021 Sergio Pedri + + \ No newline at end of file diff --git a/README.md b/README.md index 2d87a6c9..4e2dc0b4 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,22 @@ -![](https://i.imgur.com/ufWcoO6.png) -[![NuGet](https://img.shields.io/nuget/v/ComputeSharp.svg)](https://www.nuget.org/packages/ComputeSharp/) [![NuGet](https://img.shields.io/nuget/dt/ComputeSharp.svg)](https://www.nuget.org/stats/packages/ComputeSharp?groupby=Version) - -## Major update in the works! 🚀 - -The currently available NuGet package refers to the `1.x` version of **ComputeSharp**, with the codebase from the `master` branch. I'm currently working on a new major update targeting .NET 5, featuring a completely rewritten backend using native DirectX bindings and the use of C# source generators to prepare the shader code. This will greatly improve the performance of the library (especially cold start performance, which is over **10x** faster already) and use much less memory at runtime. I also plan to introduce support for a number of new features, such as the ability to use custom struct types in shaders. The current status of this work can be seen from the development branches. - -Thank you for the support! +![](https://user-images.githubusercontent.com/10199417/108635546-3512ea00-7480-11eb-8172-99bc59f4eb6f.png) +![.NET](https://github.com/Sergio0694/ComputeSharp/workflows/.NET/badge.svg) [![NuGet](https://img.shields.io/nuget/v/ComputeSharp.svg)](https://www.nuget.org/packages/ComputeSharp/) [![NuGet](https://img.shields.io/nuget/dt/ComputeSharp.svg)](https://www.nuget.org/stats/packages/ComputeSharp?groupby=Version) # What is it? -**ComputeSharp** is a .NET Standard 2.1 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders. The available APIs let you allocate GPU buffers and write compute shaders as simple lambda expressions or local methods, with all the captured variables being handled automatically and passed to the running shader. +**ComputeSharp** is a .NET 5 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders. The available APIs let you access GPU devices, allocate GPU buffers and textures, move data between them and the RAM, write compute shaders entirely in C# and have them run on the GPU. The goal of this project is to make GPU computing easy to use for all .NET developers! 🚀 # Table of Contents - [Installing from NuGet](#installing-from-nuget) - [Quick start](#quick-start) - - [Capturing variables](#capturing-variables) - - [Advanced usage](#advanced-usage) + - [Capturing variables](#capturing-variables) + - [GPU resource types](#gpu-resource-types) + - [HLSL vector and matrix types](#hlsl-vector-and-matrix-types) + - [HLSL intrinsics](#hlsl-intrinsics) + - [Working with images](#working-with-images) + - [Shader metaprogramming](#shader-metaprogramming) - [Requirements](#requirements) +- [Sponsors](#sponsors) - [Special thanks](#special-thanks) # Installing from NuGet @@ -32,40 +31,52 @@ More details available [here](https://www.nuget.org/packages/ComputeSharp/). # Quick start -**ComputeSharp** exposes a `Gpu` class that acts as entry point for all public APIs. It exposes the `Gpu.Default` property that lets you access the main GPU device on the current machine, which can be used to allocate buffers and perform operations. +**ComputeSharp** exposes a `Gpu` class that acts as entry point for all public APIs. The available `Gpu.Default` property that lets you access the main GPU device on the current machine, which can be used to allocate buffers and perform operations. If your machine doesn't have a supported GPU (or if it doesn't have a GPU at all), **ComputeSharp** will automatically create a [WARP device](https://docs.microsoft.com/windows/win32/direct3darticles/directx-warp) instead, which will still let you use the library normally, with shaders running on the CPU instead through an emulation layer. This means that you don't need to manually write a fallback path in case no GPU is available - **ComputeSharp** will automatically handle this for you. -The following sample shows how to allocate a writeable buffer, populate it with a compute shader, and read it back. +Let's suppose we want to run a simple compute shader that multiplies all items in a target buffer by two. The first step is to create the GPU buffer and copy our data to it: + +```csharp +// Get some sample data +int[] array = Enumerable.Range(0, 100).ToArray(); + +// Allocate a GPU buffer and copy the data to it. +// We want the shader to modify the items in-place, so we +// can allocate a single read-write buffer to work on. +using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(array); +``` + +The `AllocateReadWriteBuffer` extension takes care of creating a `ReadWriteBuffer` instance with the same size and contents of the input array. There are a number of overloads available as well, to create buffers of different types and with custom length. + +Next, we need to define the GPU shader to run. To do this, we'll need to define a `struct` type implementing the `IComputeShader` interface. This type will contain the code we want to run on the GPU, as well as fields representing the values we want to capture and pass to the GPU (such as GPU resources, or arbitrary values we need). In this case, we only need to capture the buffer to work on, so the shader type will look like this: ```C# -// Define a simple shader -public readonly struct MyShader : IComputeShader +[AutoConstructor] +public readonly struct MultiplyByTwo : IComputeShader { public readonly ReadWriteBuffer buffer; - public MyShader(ReadWriteBuffer buffer) + public void Execute() { - this.buffer = buffer; - } - - public void Execute(ThreadIds ids) - { - buffer[ids.X] = ids.X; + buffer[ThreadIds.X] *= 2; } } +``` -// Allocate a writeable buffer on the GPU, with the contents of the array -using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1000); +We're using the `[AutoConstructor]` attribute included in **ComputeSharp**, which creates a constructor for our type automatically. The shader body is also using a special `ThreadIds` class, which is one of the available special classes to access dispatch parameters from within a shader body. In this case, `ThreadIds` lets us access the current invocation index for the shader, just like if we were accessing the classic `i` variable from within a `for` loop. -// Run the shader -Gpu.Default.For(1000, new MyShader(buffer)); +We can now finally run the GPU shader and copy the data back to our array: + +```csharp +// Launch the shader +Gpu.Default.For(buffer.Length, new MyShader(buffer)); // Get the data back -float[] array = buffer.GetData(); +buffer.CopyTo(array); ``` ## Capturing variables -If the shader in C# is capturing some local variable, those will be automatically copied over to the GPU, so that the HLSL shader will be able to access them just like you'd expect. Additionally, **ComputeSharp** can also resolve static fields being used in a shader. The captured variables need to be convertible to valid HLSL types: either scalar types (`int`, `uint`, `float`, etc.) or known HLSL structs (eg. `Vector3`). Here is a list of the variable types currently supported by the library: +Shaders can store either GPU resources or custom values in their fields, so that they can be accessed when running on the GPU as well. This can be useful to pass some extra parameters to a shader (eg. some factor to multiply values by), that don't belong to a GPU buffer of their own. The captured variables need to be of a supported scalar or vector type so that they can be correctly used by the GPU shader in HLSL. Here is a list of the variable types currently supported by the library: ✅ .NET scalar types: `bool`, `int`, `uint`, `float`, `double` @@ -73,85 +84,190 @@ If the shader in C# is capturing some local variable, those will be automaticall ✅ HLSL types: `Bool`, `Bool2`, `Bool3`, `Bool4`, `Float2`, `Float3`, `Float4`, `Int2`, `Int3`, `Int4`, `UInt2`, `Uint3`, etc. -✅ `static` fields of both scalar, vector or buffer types +✅ HLSL matrix types: `Float2x2`, `Float3x3`, `Float3x4`, `Float4x4`, `Float1x4`, `Float4x`, etc. -✅ `static` properties, same as with fields +✅ Custom `struct` types containing any of the types above, as well as other valid custom `struct` types -✅ `Func`s or delegates with a valid HLSL signature, with the target method being `static` +## GPU resource types -✅ `Func`s, local methods or delegates with no captured variables +There are a number of extension APIs for the `GraphicsDevice` class that can be used to allocate GPU resources. Here is a breakdown of the main resource types that are available: -✅ `static` fields and properties with a supported delegate type +- `ReadWriteBuffer`: this type can be viewed as the equivalent of the `T[]` type, and can contain a writeable sequence of any of the supported types mentioned above. It is very flexible and works well in most situations. If you're just getting started with this library and are not sure about what kind of buffer to use, this is usually a good choice. +- `ReadOnlyBuffer`: this type represents a sequence of items that the GPU cannot write to. It is particularly useful to declare intent from within a compute shader and to avoid accidentally writing to data that is not supposed to change during the execution of a shader. +- `ConstantBuffer`: this type is meant to be used for small sequences of items that never change during the execution of a shader. Compared to `ReadOnlyBuffer` is has more constraints, but can benefit from better caching on the GPU side (it is recommended to verify with proper benchmarking that this type is appropriate to use). Items within a `ConstantBuffer` instance are packed to 16 bytes, which helps the GPU to have a particularly fast access time to them, but the total size of the buffer is limited to around 64KB. Copying to and from this buffer can also have additional overhead, as the GPU needs to account for the possible padding for each item (as the 16 bytes alignment is not present on the CPU side). If you're in doubt about which buffer type to use, just use either `ReadOnlyBuffer` or `ReadWriteBuffer`, depending on whether or not you also need write access to that buffer on the GPU side. +- `ReadOnlyTexture2D` and `ReadWriteTexture2D`: these types represent a 2D texture with elements of a specific type. Note that textures are not just 2D arrays, and have additional characteristics and limitations. Items in a texture are stored with a tiled layout instead of with the classic row-major order that .NET `T[,]` arrays have, and this allows them to be extremely fast when accessing small areas of neighbouring items (due to better cache locality). This can offer a big performance speedup in operations that have a similar memory access pattern, such as blur effect or convolutions in general. Textures also have limitations in the type of items they can contain (eg. custom `struct` types are not supported), and you can check if a specific type is supported at runtime with the `GraphicsDevice.IsReadOnlyTexture2DSupportedForType()` and `IsReadWriteTexture2DSupportedForType()` methods. +- `ReadOnlyTexture3D` and `ReadWriteTexture3D`: these are just like 2D textures, but in 3 dimensions. The same characteristics and limitations apply, with the addition of the fact that the depth axis has a much smaller limit on the size it can have. The `GraphicsDevice.IsReadOnlyTexture3DSupportedForType()` and `IsReadWriteTexture3DSupportedForType()` methods can be used to check for type support at runtime. +- `ReadOnlyTexture2D` and `ReadWriteTexture2D`: these texture types are particularly useful when doing image processing from a compute shader, as they allow the CPU to perform pixel format conversion automatically. The two type parameters indicate the type of items in a texture when exposed on the CPU side (as `T` items) or on the GPU side (as `TPixel` items). The type parameter `T` can be any of the existing pixel formats available in **ComputeSharp** (such as `Rgba32` and `Bgra32`), while the `TPixel` parameter represents the type of elements the GPU will be working with (for instance, `Float4` for `Rgba32`). These texture types have a number of benefits such as lower memory usage and reduced overhead on the CPU (as there is no need to manually do the pixel format conversion when copying data back and forth from the GPU). +- `ReadOnlyTexture3D` and `ReadWriteTexture3D`: these types are just like their 2D equivalent types, with the same support for automatic pixel format conversion on the GPU side. +- `UploadBuffer`: this type can be used in more advanced scenarios where performance is particularly important. It represents a buffer that can be copied directly to a GPU buffer (such as a `ReadOnlyBuffer`), without the need to create a temporary transfer buffer to do so. If there is a large number of copy operations being performed to GPU buffers, it can be beneficial to create a single `UploadBuffer` instance to load data to copy to the GPU, and execute the copy from there. +- `ReadBackBuffer`: this type is another advanced buffer type that is analogous to `UploadBuffer`, but that can be used to copy data back from a GPU buffer. In particular, this buffer can also be accessed quickly by the GPU when reading or writing data from it, so it can also be used for further processing of data on the CPU side, without the need to copy the data onto another buffer first (such as a .NET array). +- `UploadTexture2D`, `UploadTexture3D`, `ReadBackTexture2D` and `ReadBackTexture3D`: these types are conceptually similar to `UploadBuffer` and `ReadBackBuffer`, with the main difference being that they can be used to copy data back and forth from 2D and 3D textures respectively. -## Allocating GPU buffers +> **NOTE:** although the various APIs to allocate buffers are simply generic methods with a `T : unmanaged` constrain, they should only be used with C# types that are supported (see notes above). Additionally, the `bool` type should not be used in buffers due to C#/HLSL differences: use the `Bool` type instead (or just an `int` buffer). -There are a number of extension APIs for the `GraphicsDevice` class that can be used to allocate GPU buffers of three types: `ConstantBuffer`, `ReadOnlyBuffer` and `ReadWriteBuffer`. The first is packed to 16 bytes and provides the fastest possible access for buffer elements, but it has a limited maximum size (around 64KB) and requires additional overhead when copying data to and from it if the size of each element is not a multiple of 16. The other buffer types are tightly packed and work great for all kinds of operations, and can be thought of the HLSL equivalent of `T[]` arrays in C#. If you're in doubt about which buffer type to use, just use either `ReadOnlyBuffer` or `ReadWriteBuffer`, depending on whether or not you also need write access to that buffer on the GPU side. +## HLSL vector and matrix types -**NOTE:** although the APIs to allocate buffers are simply generic methods with a `T : unmanaged` constrain, they should only be used with C# types that are fully mapped to HLSL types. That means either `int`, `uint`, `float`, `double`, .NET vector types or HLSL types. The `bool` type should not be used in buffers due to C#/HLSL differences: use the `Bool` type instead. +As mentioned in the [Capturing variables](#capturing-variables) paragraph, **ComputeSharp** also exposes matrix types that can be used in compute shaders. These values store individual component values in row-major order (for consistency with .NET arrays) and can be indexed in several ways just like with HLSL vector types. One noticeable difference compared to HLSL vector types though is the lack of explicit properties to extract swizzled vectors (eg. `Float4.XZY` returns a `Float3` value with the `X`, `Z` and `Y` components). Due to the number of possible combinations being simply too high in the case of matrix types (eg. `Float4x4` alone would have had over 160k properties), the ability to extract swizzled vectors ([see here](https://docs.microsoft.com/windows/win32/direct3dhlsl/dx-graphics-hlsl-per-component-math)) can be achieved through the use of a special indexer property and values from the `MatrixIndex` type. Here is how it can be used: -## Advanced usage +```csharp +Float4x4 matrix = default; -**ComputeSharp** lets you dispatch compute shaders over thread groups from 1 to 3 dimensions, includes supports for constant and readonly buffers, and more. Additionally, most of the [HLSL intrinsic functions](https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-intrinsic-functions) are available through the `Hlsl` class. Here is a more advanced sample showcasing all these features. +// Standard indexer for rows and individual items +Float4 row = matrix[0]; +float item = matrix[0][1]; -```C# -// Define a class with some utility static functions -public static class Activations +// Swizzled indexers, which can be made less verbose to +// write by adding this using static directive to the file +using static ComputeSharp.MatrixIndex; + +Float4 diagonal = matrix[M11, M22, M33, M44]; +Float4 vertices = matrix[M11, M14, M44, M41]; +``` + +Matrix types also include a number of built-in operators to work with vector types, and the `Hlsl` class detailed below (see [HLSL intrinsics](#hlsl-intrinsics)) also includes several overloads for the available methods to work on both matrix and vector types at the same time (eg. for row/matrix multiplication). + +## HLSL intrinsics + +**ComputeSharp** offers support for all HLSL intrinsics that can be used from compute shaders. These are special functions (usually representing mathematical operations) that are optimized on the GPU and can execute very efficiently. Some of them can be mapped automatically from methods in the `System.Math` type (such as `Math.Sin` and `Math.Cos`), but if you want to have direct access to all of them you can just use the methods in the `Hlsl` class from a compute shader, and **ComputeSharp** will rewrite all those calls to use the native intrinsics in the compute shaders where those are used. + +Here's an example of a shader that applies the [softmax function](https://en.wikipedia.org/wiki/Rectifier_(neural_networks)) to all the items in a given buffer: + +```csharp +[AutoConstructor] +public readonly struct SoftmaxActivation : IComputeShader { - public static float Sigmoid(float x) => 1 / (1 + Hlsl.Exp(-x)); -} - -// Define the shader -public readonly struct ActivationShader : IComputeShader -{ - private readonly int width; - - public readonly ReadOnlyBuffer x; - public readonly ReadWriteBuffer y; - - public ActivationShader( - int width, - ReadOnlyBuffer x, - ReadWriteBuffer y) - { - this.width = width; - this.x = x; - this.y = y; - } + public readonly ReadWriteBuffer buffer; + public readonly float k; public void Execute(ThreadIds ids) { - int offset = ids.X + ids.Y * width; - float pow = Hlsl.Pow(x[offset], 2); - y[offset] = Activations.Sigmoid(pow); + float exp = Hlsl.Exp(k * buffer[ThreadIds.X]); + float log = Hlsl.Log(1 + exp); + + buffer[ThreadIds.X] = log / k; } } +``` -int height = 10, width = 10; -float[] x = new float[height * width]; // Array to sum to y -float[] y = new float[height * width]; // Result array (assume both had some values) +## Working with images -using ReadOnlyBuffer xBuffer = Gpu.Default.AllocateReadOnlyBuffer(x); -using ReadWriteBuffer yBuffer = Gpu.Default.AllocateReadWriteBuffer(y); +As mentioned in the [GPU resource types](#gpu-resource-types) paragraph, there are several texture types that are specialized to work on image pixels, such as `ReadWriteTexture2D`. Let's imagine we want to write a compute shader that applies some image processing filter: we will need to load an image (eg. using [ImageSharp](https://github.com/SixLabors/ImageSharp), or just the `System.Drawing` APIs) and then process it on the GPU, but without spending time on the CPU to convert pixels from a format such as RGBA32 to the normalized `float` values we want our shader to work on. We can do this by utilizing the `ReadWriteTexture2D` type as follows: + +```csharp +// Load a bitmap from a specified path and then lock the pixel data. +// The locked pixels are in the BGRA32 format, which is the one we need. +var bitmap = new Bitmap("myImage.jpg"); +var bitmapData = bitmap.LockBits( + new Rectangle(0, 0, bitmap.Width, bitmap.Height), + ImageLockMode.ReadWrite, + PixelFormat.Format32bppArgb); + +try +{ + // Create a span over the locked pixel data, of type Bgra32 (from ComputeSharp) + var bitmapSpan = new Span((Bgra32*)bitmapData.Scan0, bitmapData.Width * bitmapData.Height); + + // Allocate a 2D texture by directly reading from the pixel data + using var texture = Gpu.Default.AllocateReadWriteTexture2D(bitmapSpan, bitmap.Width, bitmap.Height); + + // Run our shader on the texture we just created + Gpu.Default.For(bitmap.Width, bitmap.Height, new GaussianBlur(texture)); + + // When the shader has completed, copy the processed texture back + texture.CopyTo(bitmapSpan); +} +finally +{ + bitmap.UnlockBits(bitmapData); +} + +bitmap.Save("myImage.jpg"); +``` + +With the compute shader being like this: + +```csharp +[AutoConstructor] +public readonly partial struct GaussianBlur : IComputeShader +{ + public readonly IReadWriteTexture2D texture; + + // Other captured resources or values here... + + public void Execute() + { + // Our image processing logic here. In this example, we are just + // applying a naive grayscale effect to all pixels in the image. + Float3 rgb = texture[ThreadIds.XY].RGB; + float avg = Hlsl.Dot(rgb, new(0.0722f, 0.7152f, 0.2126f)); + + texture[ThreadIds.XY].RGB = avg; + } +} +``` + +> **NOTE:** this is just an example to illustrate how these texture types can help with automatic pixel format conversion. You're free to use any library of choice to load and save image data, as well as to how to structure your compute shaders representing image effects. This is just one of the infinite possible effects that could be achieved by using **ComputeSharp**. + +## Shader metaprogramming + +One of the reasons why **ComputeSharp** compiles shaders at runtime is that it allows it to support a number of dynamic scenarios, including shader metaprogramming. What this means is that it's possible to have a shader that captures an instance of a `Delegate` type (provided the signature matches the supported types mentioned above), and reuse it with different methods. The library will automatically run different variations of the shaders depending on what methods they are capturing. Here is an example: + +```csharp +// Define a function we want to use in our shader. Captured functions +// need to be static methods annotated with [ShaderAttribute]. +[ShaderMethod] +public static float Square(float x) => x * x; + +[AutoConstructor] +public readonly struct ApplyFunction : IComputeShader +{ + public readonly ReadWriteBuffer buffer; + public readonly Func function; + + public void Execute() + { + buffer[ThreadIds.X] = function(buffer[ThreadIds.X]); + } +} +``` + +Then we can simply create a new `Func` instance and use that to construct a new instance of the `ApplyFunction` type, to execute that shader on a target buffer. **ComputeSharp** will build or reuse a version of that shader with the supplied captured function and execute it on the GPU: + +```csharp +float[] array = LoadSampleData(); + +// Allocate the buffer and copy data to it +using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(array); // Run the shader -Gpu.Default.For(width, height, new ActivationShader(width, xBuffer, yBuffer)); +Gpu.Default.For(width, height, new ApplyFunction(buffer, Square)); -// Get the data back and write it to the y array -yBuffer.GetData(y); +// Copy the processed data back as usual +buffer.CopyTo(array); ``` # Requirements -The **ComputeSharp** library requires .NET Standard 2.1 support, and it is available for applications targeting: -- .NET Core >= 3.0 -- Windows (x86 or x64) +The **ComputeSharp** library has the following requirements: +- .NET 5 +- Windows x64 -Additionally, you need an IDE with .NET Core 3.1 and C# 8.0 support to compile the library and samples on your PC. +Additionally, in order to compile the library or a project using it, you need a recent build of Visual Studio 2019 or another IDE that has support for Roslyn source generators, as **ComputeSharp** relies on this feature to create the HLSL shader sources and to extract other shader metadata that is necessary to setup and execute the code at runtime. You can learn more about source generators [here](https://devblogs.microsoft.com/dotnet/introducing-c-source-generators/). + +# Sponsors + +Huge thanks to these sponsors for directly supporting my work on **ComputeSharp**, it means a lot! 🙌 + + + + # Special thanks -The **ComputeSharp** library is based on some of the code from the [DX12GameEngine](https://github.com/Aminator/DirectX12GameEngine) repository by [Amin Delavar](https://github.com/Aminator). Additionally, **ComputeSharp** uses NuGet packages from the following repositories (excluding those from Microsoft): +The **ComputeSharp** library was originally based on some of the code from the [DX12GameEngine](https://github.com/Aminator/DirectX12GameEngine) repository by [Amin Delavar](https://github.com/Aminator). -- [Vortice.Windows](https://github.com/amerkoleci/Vortice.Windows) -- [ILSpy](https://github.com/icsharpcode/ILSpy) -- [Stubble](https://github.com/StubbleOrg/Stubble) +Additionally, **ComputeSharp** uses NuGet packages from the following repositories: + +- [Microsoft.Toolkit.Diagnostics](https://github.com/windows-toolkit/WindowsCommunityToolkit) +- [TerraFX.Interop.Windows](https://github.com/terrafx/terrafx.interop.windows) +- [TerraFX.Interop.D3D12MemoryAllocator](https://github.com/terrafx/terrafx.interop.d3d12memoryallocator) \ No newline at end of file diff --git a/global.json b/global.json new file mode 100644 index 00000000..9685cb85 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "5.0.x" + } +} \ No newline at end of file diff --git a/nuget.config b/nuget.config new file mode 100644 index 00000000..c5173dab --- /dev/null +++ b/nuget.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs new file mode 100644 index 00000000..5282758b --- /dev/null +++ b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs @@ -0,0 +1,162 @@ +using System; +using System.Buffers; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Engines; + +namespace ComputeSharp.Benchmark.Blas +{ + /// + /// A that benchmarks the APIs in the class, on both CPU and GPU. + /// + [SimpleJob(RunStrategy.Monitoring)] + public class BlasBenchmark : IDisposable + { + /// + /// The number of samples. + /// + private const int C = 128; + + /// + /// The nummber of rows in the matrix. + /// + private const int N = 512; + + /// + /// The number of columns in the matrix (same as the number of rows in the matrix) + /// + private const int M = 512; + + /// + /// The number of columns in the matrix. + /// + private const int P = 256; + + /// + /// The input tensor. + /// + private float[]? X; + + /// + /// The weights tensor. + /// + private float[]? W; + + /// + /// The bias tensor. + /// + private float[]? B; + + /// + /// The result tensor. + /// + private float[]? Y; + + /// + /// The input tensor (GPU). + /// + private ReadOnlyBuffer? BufferX; + + /// + /// The weights tensor (GPU). + /// + private ReadOnlyBuffer? BufferW; + + /// + /// The bias tensor (GPU). + /// + private ReadOnlyBuffer? BufferB; + + /// + /// The result tensor (GPU). + /// + private ReadWriteBuffer? BufferY; + + /// + /// A instance to initialize the tensors. + /// + private readonly Random Random = new Random(); + + /// + /// Initial setup for a benchmarking session. + /// + [GlobalSetup] + public void Setup() + { + // Creates a new random normalized float[] array of a given size + float[] CreateRandomArray(int size) + { + float[] array = ArrayPool.Shared.Rent(size); + + foreach (ref float x in array.AsSpan()) + { + x = (float)Random.NextDouble(); + } + + return array; + } + + X = CreateRandomArray(C * N * M); + W = CreateRandomArray(M * P); + B = CreateRandomArray(P); + Y = CreateRandomArray(C * N * P); + + BufferX = Gpu.Default.AllocateReadOnlyBuffer(X); + BufferW = Gpu.Default.AllocateReadOnlyBuffer(W); + BufferB = Gpu.Default.AllocateReadOnlyBuffer(B); + BufferY = Gpu.Default.AllocateReadWriteBuffer(Y); + + Cpu(); + GpuWithNoTemporaryBuffers(); + GpuWithTemporaryBuffers(); + } + + /// + [GlobalCleanup] + public void Dispose() + { + ArrayPool.Shared.Return(X!); + ArrayPool.Shared.Return(W!); + ArrayPool.Shared.Return(B!); + ArrayPool.Shared.Return(Y!); + + BufferX!.Dispose(); + BufferW!.Dispose(); + BufferB!.Dispose(); + BufferY!.Dispose(); + } + + /// + /// Runs a fully connected forward operation on the CPU. + /// + [Benchmark(Baseline = true)] + public void Cpu() + { + BlasHelpers.FullyConnectedForwardCpu(C, N, M, P, X!, W!, B!, Y!); + } + + /// + /// Runs a fully connected forward operation on the GPU. + /// + [Benchmark] + public void GpuWithNoTemporaryBuffers() + { + BlasHelpers.FullyConnectedForwardGpu(Gpu.Default, C, N, M, P, BufferX!, BufferW!, BufferB!, BufferY!); + } + + /// + /// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations. + /// + [Benchmark] + public void GpuWithTemporaryBuffers() + { + using ReadOnlyBuffer x = Gpu.Default.AllocateReadOnlyBuffer(X!); + using ReadOnlyBuffer w = Gpu.Default.AllocateReadOnlyBuffer(W!); + using ReadOnlyBuffer b = Gpu.Default.AllocateReadOnlyBuffer(B!); + using ReadWriteBuffer y = Gpu.Default.AllocateReadWriteBuffer(Y!.Length); + + BlasHelpers.FullyConnectedForwardGpu(Gpu.Default, C, N, M, P, x, w, b, y); + + y.CopyTo(Y); + } + } +} diff --git a/samples/ComputeSharp.Benchmark/Dnn.cs b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs similarity index 51% rename from samples/ComputeSharp.Benchmark/Dnn.cs rename to samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs index 904ddd78..d1e3df0a 100644 --- a/samples/ComputeSharp.Benchmark/Dnn.cs +++ b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs @@ -1,24 +1,24 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; -namespace ComputeSharp.Benchmark +namespace ComputeSharp.Benchmark.Blas { /// - /// A that contains primitives to run certain operations of a neural network + /// A that contains primitives to run certain operations of a neural network. /// - internal static class Dnn + internal static partial class BlasHelpers { /// - /// Executes the forward pass on a fully connected layer on the CPU + /// Executes the forward pass on a fully connected layer on the CPU. /// - /// The number of samples in the input tensor - /// The number of rows in the input matrix - /// The number of columns in the input matrix - /// The number of columns in the output matrix - /// The input tensor - /// The weights tensor - /// The bias tensor - /// The result tensor + /// The number of samples in the input tensor. + /// The number of rows in the input matrix. + /// The number of columns in the input matrix. + /// The number of columns in the output matrix. + /// The input tensor. + /// The weights tensor. + /// The bias tensor. + /// The result tensor. public static void FullyConnectedForwardCpu(int c, int n, int m, int p, float[] x, float[] w, float[] b, float[] y) { void Kernel(int s) @@ -51,69 +51,58 @@ namespace ComputeSharp.Benchmark } /// - /// Executes the forward pass on a fully connected layer on the GPU + /// Executes the forward pass on a fully connected layer on the GPU. /// - /// The number of samples in the input tensor - /// The number of rows in the input matrix - /// The number of columns in the input matrix - /// The number of columns in the output matrix - /// The input tensor - /// The weights tensor - /// The bias tensor - /// The result tensor + /// The device to run the computation on. + /// The number of samples in the input tensor. + /// The number of rows in the input matrix. + /// The number of columns in the input matrix. + /// The number of columns in the output matrix. + /// The input tensor. + /// The weights tensor. + /// The bias tensor. + /// The result tensor. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void FullyConnectedForwardGpu( - int c, int n, int m, int p, - ReadOnlyBuffer x, ReadOnlyBuffer w, ReadOnlyBuffer b, ReadWriteBuffer y) + GraphicsDevice device, + int c, + int n, + int m, + int p, + ReadOnlyBuffer x, + ReadOnlyBuffer w, + ReadOnlyBuffer b, + ReadWriteBuffer y) { - Gpu.Default.For(c, n, p, new FullyConnectedForwardKernel(n, m, p, x, w, b, y)); + device.For(c, n, p, new FullyConnectedForwardKernel(n, m, p, x, w, b, y)); } /// - /// Kernel for + /// Kernel for . /// - private readonly struct FullyConnectedForwardKernel : IComputeShader + [AutoConstructor] + public readonly partial struct FullyConnectedForwardKernel : IComputeShader { - private readonly int n; - private readonly int m; - private readonly int p; - - private readonly ReadOnlyBuffer x; - private readonly ReadOnlyBuffer w; - private readonly ReadOnlyBuffer b; - private readonly ReadWriteBuffer y; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public FullyConnectedForwardKernel( - int n, - int m, - int p, - ReadOnlyBuffer x, - ReadOnlyBuffer w, - ReadOnlyBuffer b, - ReadWriteBuffer y) - { - this.n = n; - this.m = m; - this.p = p; - this.x = x; - this.w = w; - this.b = b; - this.y = y; - } + public readonly int n; + public readonly int m; + public readonly int p; + public readonly ReadOnlyBuffer x; + public readonly ReadOnlyBuffer w; + public readonly ReadOnlyBuffer b; + public readonly ReadWriteBuffer y; /// - public void Execute(ThreadIds ids) + public void Execute() { - int x_offset = ids.X * n * p + ids.Y * m; + int x_offset = ThreadIds.X * n * p + ThreadIds.Y * m; float result = 0f; for (int k = 0; k < m; k++) { - result += x[x_offset + k] * w[k * p + ids.Z]; + result += x[x_offset + k] * w[k * p + ThreadIds.Z]; } - y[ids.X * n * p + ids.Y * p + ids.Z] = result + b[ids.Z]; + y[ThreadIds.X * n * p + ThreadIds.Y * p + ThreadIds.Z] = result + b[ThreadIds.Z]; } } } diff --git a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj index 0c070ff3..44e91014 100644 --- a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj +++ b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj @@ -2,15 +2,32 @@ Exe - netcoreapp3.1 + net5.0 + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/samples/ComputeSharp.Benchmark/DnnBenchmark.cs b/samples/ComputeSharp.Benchmark/DnnBenchmark.cs deleted file mode 100644 index f7fc3936..00000000 --- a/samples/ComputeSharp.Benchmark/DnnBenchmark.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Buffers; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; -using BenchmarkDotNet.Attributes; - -namespace ComputeSharp.Benchmark -{ - /// - /// A that benchmarks the APIs in the class, on both CPU and GPU - /// - public class DnnBenchmark : IDisposable - { - /// - /// The number of samples - /// - private const int C = 128; - - /// - /// The nummber of rows in the matrix - /// - private const int N = 512; - - /// - /// The number of columns in the matrix (same as the number of rows in the matrix) - /// - private const int M = 512; - - /// - /// The number of columns in the matrix - /// - private const int P = 256; - - /// - /// The input tensor - /// - private float[] X; - - /// - /// The weights tensor - /// - private float[] W; - - /// - /// The bias tensor - /// - private float[] B; - - /// - /// The result tensor - /// - private float[] Y; - - /// - /// The input tensor - /// - private ReadOnlyBuffer BufferX; - - /// - /// The weights tensor - /// - private ReadOnlyBuffer BufferW; - - /// - /// The bias tensor - /// - private ReadOnlyBuffer BufferB; - - /// - /// The result tensor - /// - private ReadWriteBuffer BufferY; - - /// - /// A instance to initialize the tensors - /// - private readonly Random Random = new Random(); - - /// - /// Initial setup for a benchmarking session - /// - [GlobalSetup] - public void Setup() - { - X = CreateRandomArray(C * N * M); - W = CreateRandomArray(M * P); - B = CreateRandomArray(P); - Y = CreateRandomArray(C * N * P); - - BufferX = Gpu.Default.AllocateReadOnlyBuffer(X); - BufferW = Gpu.Default.AllocateReadOnlyBuffer(W); - BufferB = Gpu.Default.AllocateReadOnlyBuffer(B); - BufferY = Gpu.Default.AllocateReadWriteBuffer(Y); - } - - /// - /// Clears the memory from the current session - /// - [GlobalCleanup] - public void Dispose() - { - ArrayPool.Shared.Return(X); - ArrayPool.Shared.Return(W); - ArrayPool.Shared.Return(B); - ArrayPool.Shared.Return(Y); - - BufferX.Dispose(); - BufferW.Dispose(); - BufferB.Dispose(); - BufferY.Dispose(); - } - - /// - /// Creates a new array of the specified size - /// - /// The size of the new random array to create - [Pure] - private float[] CreateRandomArray(int size) - { - float[] array = ArrayPool.Shared.Rent(size); - ref float r = ref array[0]; - for (int i = 0; i < size; i++) - { - Unsafe.Add(ref r, i) = (float)Random.NextDouble(); - } - - return array; - } - - /// - /// Runs a fully connected forward operation on the CPU - /// - [Benchmark(Baseline = true)] - public void Cpu() => Dnn.FullyConnectedForwardCpu(C, N, M, P, X, W, B, Y); - - /// - /// Runs a fully connected forward operation on the GPU - /// - [Benchmark] - public void GpuWithNoTemporaryBuffers() => Dnn.FullyConnectedForwardGpu(C, N, M, P, BufferX, BufferW, BufferB, BufferY); - - /// - /// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations - /// - [Benchmark] - public void GpuWithTemporaryBuffers() - { - using ReadOnlyBuffer x = Gpu.Default.AllocateReadOnlyBuffer(X); - using ReadOnlyBuffer w = Gpu.Default.AllocateReadOnlyBuffer(W); - using ReadOnlyBuffer b = Gpu.Default.AllocateReadOnlyBuffer(B); - using ReadWriteBuffer y = Gpu.Default.AllocateReadWriteBuffer(Y); - - Dnn.FullyConnectedForwardGpu(C, N, M, P, x, w, b, y); - - y.GetData(Y); - } - } -} diff --git a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs new file mode 100644 index 00000000..ef208625 --- /dev/null +++ b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs @@ -0,0 +1,91 @@ +using System; +using System.IO; +using System.Reflection; +using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Engines; +using ComputeSharp.BokehBlur.Processors; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Convolution; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; + +namespace ComputeSharp.Benchmark.Imaging +{ + /// + /// A that benchmarks the image processors against the reference in ImageSharp. + /// + [SimpleJob(RunStrategy.Monitoring)] + [CategoriesColumn] + [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] + public class ImagingBenchmark : IDisposable + { + /// + /// The loaded image. + /// + private Image? image; + + /// + /// Initial setup for a benchmarking session. + /// + [GlobalSetup] + public void Setup() + { + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); + + this.image = Image.Load(path); + + Bokeh_Cpu(); + Bokeh_Gpu(); + Gaussian_Cpu(); + Gaussian_Gpu(); + } + + /// + [GlobalCleanup] + public void Dispose() + { + this.image!.Dispose(); + } + + /// + /// Runs a bokeh blur effect on the CPU. + /// + [Benchmark(Baseline = true)] + [BenchmarkCategory("BOKEH")] + public void Bokeh_Cpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new BokehBlurProcessor(80, 2, 3))); + } + + /// + /// Runs a bokeh blur effect on the GPU. + /// + [Benchmark] + [BenchmarkCategory("BOKEH")] + public void Bokeh_Gpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new HlslBokehBlurProcessor(80, 2))); + } + + /// + /// Runs a gaussian blur effect on the CPU. + /// + [Benchmark(Baseline = true)] + [BenchmarkCategory("GAUSSIAN")] + public void Gaussian_Cpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new GaussianBlurProcessor(80))); + } + + /// + /// Runs a gaussian blur effect on the GPU. + /// + [Benchmark] + [BenchmarkCategory("GAUSSIAN")] + public void Gaussian_Gpu() + { + this.image!.Mutate(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(80))); + } + } +} diff --git a/samples/ComputeSharp.Benchmark/Program.cs b/samples/ComputeSharp.Benchmark/Program.cs index 3667f4c3..0c321dcc 100644 --- a/samples/ComputeSharp.Benchmark/Program.cs +++ b/samples/ComputeSharp.Benchmark/Program.cs @@ -4,15 +4,15 @@ namespace ComputeSharp.Benchmark { public class Program { - public static void Main() + public static void Main(string[] args) { - /* ================= - * BenchmarkDotNet - * ================ - * In order to run this benchmark, compile this project in Release mode, - * then go to its bin\Release\netcoreapp3.0 folder, open a cmd prompt - * and type "dotnet ComputeSharp.Benchmark.dll */ - BenchmarkRunner.Run(); + // ================= + // BenchmarkDotNet + // ================ + // In order to run this benchmark, compile this project in Release mode, + // then go to its bin\Release\netcoreapp3.0 folder, open a cmd prompt + // and type "dotnet ComputeSharp.Benchmark.dll" to execute it. + BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); } } } diff --git a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj index 44109545..bdeeafa3 100644 --- a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj +++ b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj @@ -2,25 +2,23 @@ Exe - netcoreapp3.1 + net5.0 - + - - PreserveNewest - - - - - + + diff --git a/samples/ComputeSharp.ImageProcessing/Primitives/Complex64.cs b/samples/ComputeSharp.ImageProcessing/Primitives/Complex64.cs new file mode 100644 index 00000000..e14516c1 --- /dev/null +++ b/samples/ComputeSharp.ImageProcessing/Primitives/Complex64.cs @@ -0,0 +1,46 @@ +// Copyright (c) Six Labors. +// Licensed under the Apache License, Version 2.0. + +using System.Runtime.CompilerServices; + +namespace SixLabors.ImageSharp +{ + /// + /// Represents a complex number, where the real and imaginary parts are stored as values. + /// + /// + /// This is a more efficient version of the type. + /// + internal readonly struct Complex64 + { + /// + /// The real part of the complex number. + /// + public readonly float Real; + + /// + /// The imaginary part of the complex number. + /// + public readonly float Imaginary; + + /// + /// Initializes a new instance of the struct. + /// + /// The real part in the complex number. + /// The imaginary part in the complex number. + public Complex64(float real, float imaginary) + { + this.Real = real; + this.Imaginary = imaginary; + } + + /// + /// Performs the multiplication operation between a instance and a scalar. + /// + /// The value to multiply. + /// The scalar to use to multiply the value. + /// The result. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Complex64 operator *(Complex64 value, float scalar) => new Complex64(value.Real * scalar, value.Imaginary * scalar); + } +} \ No newline at end of file diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs index 2ae2eef1..25e9dfc9 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.cs @@ -1,67 +1,85 @@ -using SixLabors.ImageSharp; +using System.Runtime.CompilerServices; +using Microsoft.Toolkit.Diagnostics; +using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; namespace ComputeSharp.BokehBlur.Processors { /// - /// Applies bokeh blur processing to the image + /// Applies bokeh blur processing to the image. /// - public sealed class HlslBokehBlurProcessor : IImageProcessor + public sealed partial class HlslBokehBlurProcessor : IImageProcessor { /// - /// The default radius used by the parameterless constructor + /// The default radius used by the parameterless constructor. /// public const int DefaultRadius = 32; /// - /// The default component count used by the parameterless constructor + /// The default component count used by the parameterless constructor. /// public const int DefaultComponents = 2; /// - /// The default gamma used by the parameterless constructor + /// Initializes a new instance of the class. /// - public const float DefaultGamma = 3f; - - /// - /// Initializes a new instance of the class - /// - public HlslBokehBlurProcessor() : this(DefaultRadius, DefaultComponents, DefaultGamma) { } - - /// - /// Initializes a new instance of the class - /// - /// The size of the area to sample - /// The number of components to use to approximate the original 2D bokeh blur convolution kernel - /// The gamma highlight factor to use to further process the image - public HlslBokehBlurProcessor(int radius, int components, float gamma) + public HlslBokehBlurProcessor() + : this(Gpu.Default, DefaultRadius, DefaultComponents) { - Radius = radius; - Components = components; - Gamma = gamma; } /// - /// Gets the radius + /// Initializes a new instance of the class. + /// + /// The size of the area to sample. + /// The number of components to use to approximate the original 2D bokeh blur convolution kernel. + public HlslBokehBlurProcessor(int radius, int components) + : this(Gpu.Default, radius, components) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The associated with the current instance. + /// The size of the area to sample. + /// The number of components to use to approximate the original 2D bokeh blur convolution kernel. + public HlslBokehBlurProcessor(GraphicsDevice device, int radius, int components) + { + GraphicsDevice = device; + Radius = radius; + Components = components; + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the radius. /// public int Radius { get; } /// - /// Gets the number of components + /// Gets the number of components. /// public int Components { get; } - /// - /// Gets the gamma highlight factor to use when applying the effect - /// - public float Gamma { get; } - /// public IImageProcessor CreatePixelSpecificProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) where TPixel : unmanaged, IPixel { - return new HlslBokehBlurProcessor(this, configuration, source, sourceRectangle); + if (typeof(TPixel) != typeof(ImageSharpRgba32)) + { + ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); + } + + var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); + + return Unsafe.As>(processor); } } } diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs index b400ecce..eddd54af 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs @@ -1,563 +1,426 @@ using System; -using System.Buffers; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Diagnostics.Contracts; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Microsoft.Toolkit.Diagnostics; using SixLabors.ImageSharp; -using SixLabors.ImageSharp.Advanced; -using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; namespace ComputeSharp.BokehBlur.Processors { - /// - /// Applies bokeh blur processing to the image - /// - /// The pixel format - /// This processor is based on the code from Mike Pound, see github.com/mikepound/convolve - public sealed class HlslBokehBlurProcessor : ImageProcessor - where TPixel : unmanaged, IPixel + /// + public sealed partial class HlslBokehBlurProcessor { /// - /// The kernel radius + /// Applies bokeh blur processing to the image. /// - private readonly int Radius; - - /// - /// The gamma highlight factor to use when applying the effect - /// - private readonly float Gamma; - - /// - /// The maximum size of the kernel in either direction - /// - private readonly int KernelSize; - - /// - /// The number of components to use when applying the bokeh blur - /// - private readonly int ComponentsCount; - - /// - /// The kernel parameters to use for the current instance (a: X, b: Y, A: Z, B: W) - /// - private readonly Vector4[] KernelParameters; - - /// - /// The kernel components for the current instance - /// - private readonly Vector2[][] Kernels; - - /// - /// The scaling factor for kernel values - /// - private readonly float KernelsScale; - - /// - /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances - /// - private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Vector2[][] Kernels)> Cache = new ConcurrentDictionary<(int, int), (Vector4[], float, Vector2[][])>(); - - /// - /// Initializes a new instance of the class - /// - /// The defining the processor parameters - /// The configuration which allows altering default behaviour or extending the library - /// The source instance to modify - /// The source that indicates the area to edit - public HlslBokehBlurProcessor(HlslBokehBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) - : base(configuration, source, sourceRectangle) + /// This processor is based on the code from Mike Pound, see github.com/mikepound/convolve. + public sealed partial class Implementation : ImageProcessor { - Radius = definition.Radius; - KernelSize = Radius * 2 + 1; - ComponentsCount = definition.Components; - Gamma = definition.Gamma; + /// + /// The instance in use. + /// + private readonly GraphicsDevice GraphicsDevice; - // Reuse the initialized values from the cache, if possible - var parameters = (Radius, ComponentsCount); - if (Cache.TryGetValue(parameters, out var info)) + /// + /// The kernel radius. + /// + private readonly int Radius; + + /// + /// The maximum size of the kernel in either direction. + /// + private readonly int KernelSize; + + /// + /// The number of components to use when applying the bokeh blur. + /// + private readonly int ComponentsCount; + + /// + /// The kernel parameters to use for the current instance (a: X, b: Y, A: Z, B: W) + /// + private readonly Vector4[] KernelParameters; + + /// + /// The kernel components for the current instance. + /// + private readonly Complex64[][] Kernels; + + /// + /// The scaling factor for kernel values. + /// + private readonly float KernelsScale; + + /// + /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances. + /// + private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Complex64[][] Kernels)> Cache = new(); + + /// + /// Initializes a new instance of the class. + /// + /// The defining the processor parameters. + /// The configuration which allows altering default behaviour or extending the library. + /// The source instance to modify. + /// The source that indicates the area to edit. + public Implementation(HlslBokehBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) + : base(configuration, source, sourceRectangle) { - KernelParameters = info.Parameters; - KernelsScale = info.Scale; - Kernels = info.Kernels; - } - else - { - // Initialize the complex kernels and parameters with the current arguments - (KernelParameters, KernelsScale) = GetParameters(); - Kernels = CreateComplexKernels(); - NormalizeKernels(); + GraphicsDevice = definition.GraphicsDevice; + Radius = definition.Radius; + KernelSize = Radius * 2 + 1; + ComponentsCount = definition.Components; - // Store them in the cache for future use - Cache.TryAdd(parameters, (KernelParameters, KernelsScale, Kernels)); - } - } - - /// - /// Gets the kernel scales to adjust the component values in each kernel - /// - private static IReadOnlyList KernelScales { get; } = new[] { 1.4f, 1.2f, 1.2f, 1.2f, 1.2f, 1.2f }; - - /// - /// Gets the available bokeh blur kernel parameters - /// - private static IReadOnlyList KernelComponents { get; } = new[] - { - // 1 component - new[] { new Vector4(0.862325f, 1.624835f, 0.767583f, 1.862321f) }, - - // 2 components - new[] - { - new Vector4(0.886528f, 5.268909f, 0.411259f, -0.548794f), - new Vector4(1.960518f, 1.558213f, 0.513282f, 4.56111f) - }, - - // 3 components - new[] - { - new Vector4(2.17649f, 5.043495f, 1.621035f, -2.105439f), - new Vector4(1.019306f, 9.027613f, -0.28086f, -0.162882f), - new Vector4(2.81511f, 1.597273f, -0.366471f, 10.300301f) - }, - - // 4 components - new[] - { - new Vector4(4.338459f, 1.553635f, -5.767909f, 46.164397f), - new Vector4(3.839993f, 4.693183f, 9.795391f, -15.227561f), - new Vector4(2.791880f, 8.178137f, -3.048324f, 0.302959f), - new Vector4(1.342190f, 12.328289f, 0.010001f, 0.244650f) - }, - - // 5 components - new[] - { - new Vector4(4.892608f, 1.685979f, -22.356787f, 85.91246f), - new Vector4(4.71187f, 4.998496f, 35.918936f, -28.875618f), - new Vector4(4.052795f, 8.244168f, -13.212253f, -1.578428f), - new Vector4(2.929212f, 11.900859f, 0.507991f, 1.816328f), - new Vector4(1.512961f, 16.116382f, 0.138051f, -0.01f) - }, - - // 6 components - new[] - { - new Vector4(5.143778f, 2.079813f, -82.326596f, 111.231024f), - new Vector4(5.612426f, 6.153387f, 113.878661f, 58.004879f), - new Vector4(5.982921f, 9.802895f, 39.479083f, -162.028887f), - new Vector4(6.505167f, 11.059237f, -71.286026f, 95.027069f), - new Vector4(3.869579f, 14.81052f, 1.405746f, -3.704914f), - new Vector4(2.201904f, 19.032909f, -0.152784f, -0.107988f) - } - }; - - /// - /// Gets the kernel parameters and scaling factor for the current count value in the current instance - /// - private (Vector4[] Parameters, float Scale) GetParameters() - { - // Prepare the kernel components - int index = Math.Max(0, Math.Min(ComponentsCount - 1, KernelComponents.Count)); - return (KernelComponents[index], KernelScales[index]); - } - - /// - /// Creates the collection of complex 1D kernels with the specified parameters - /// - private Vector2[][] CreateComplexKernels() - { - var kernels = new Vector2[KernelParameters.Length][]; - ref Vector4 baseRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); - for (int i = 0; i < KernelParameters.Length; i++) - { - ref Vector4 paramsRef = ref Unsafe.Add(ref baseRef, i); - kernels[i] = CreateComplex1DKernel(paramsRef.X, paramsRef.Y); - } - - return kernels; - } - - /// - /// Creates a complex 1D kernel with the specified parameters - /// - /// The exponential parameter for each complex component - /// The angle component for each complex component - private Vector2[] CreateComplex1DKernel(float a, float b) - { - var kernel = new Vector2[KernelSize]; - ref Vector2 baseRef = ref MemoryMarshal.GetReference(kernel.AsSpan()); - int r = Radius, n = -r; - - for (int i = 0; i < KernelSize; i++, n++) - { - // Incrementally compute the range values - float value = n * KernelsScale * (1f / r); - value *= value; - - // Fill in the complex kernel values - Unsafe.Add(ref baseRef, i) = new Vector2( - MathF.Exp(-a * value) * MathF.Cos(b * value), - MathF.Exp(-a * value) * MathF.Sin(b * value)); - } - - return kernel; - } - - /// - /// Normalizes the kernels with respect to A * real + B * imaginary - /// - private void NormalizeKernels() - { - // Calculate the complex weighted sum - float total = 0; - Span kernelsSpan = Kernels.AsSpan(); - ref Vector2[] baseKernelsRef = ref MemoryMarshal.GetReference(kernelsSpan); - ref Vector4 baseParamsRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); - - for (int i = 0; i < KernelParameters.Length; i++) - { - ref Vector2[] kernelRef = ref Unsafe.Add(ref baseKernelsRef, i); - int length = kernelRef.Length; - ref Vector2 valueRef = ref kernelRef[0]; - ref Vector4 paramsRef = ref Unsafe.Add(ref baseParamsRef, i); - - for (int j = 0; j < length; j++) + // Reuse the initialized values from the cache, if possible + var parameters = (Radius, ComponentsCount); + if (Cache.TryGetValue(parameters, out var info)) { - for (int k = 0; k < length; k++) + KernelParameters = info.Parameters; + KernelsScale = info.Scale; + Kernels = info.Kernels; + } + else + { + // Initialize the complex kernels and parameters with the current arguments + (KernelParameters, KernelsScale) = GetParameters(); + Kernels = CreateComplexKernels(); + NormalizeKernels(); + + // Store them in the cache for future use + Cache.TryAdd(parameters, (KernelParameters, KernelsScale, Kernels)); + } + } + + /// + /// Gets the kernel scales to adjust the component values in each kernel. + /// + private static IReadOnlyList KernelScales { get; } = new[] { 1.4f, 1.2f, 1.2f, 1.2f, 1.2f, 1.2f }; + + /// + /// Gets the available bokeh blur kernel parameters. + /// + private static IReadOnlyList KernelComponents { get; } = new[] + { + // 1 component + new[] { new Vector4(0.862325f, 1.624835f, 0.767583f, 1.862321f) }, + + // 2 components + new[] + { + new Vector4(0.886528f, 5.268909f, 0.411259f, -0.548794f), + new Vector4(1.960518f, 1.558213f, 0.513282f, 4.56111f) + }, + + // 3 components + new[] + { + new Vector4(2.17649f, 5.043495f, 1.621035f, -2.105439f), + new Vector4(1.019306f, 9.027613f, -0.28086f, -0.162882f), + new Vector4(2.81511f, 1.597273f, -0.366471f, 10.300301f) + }, + + // 4 components + new[] + { + new Vector4(4.338459f, 1.553635f, -5.767909f, 46.164397f), + new Vector4(3.839993f, 4.693183f, 9.795391f, -15.227561f), + new Vector4(2.791880f, 8.178137f, -3.048324f, 0.302959f), + new Vector4(1.342190f, 12.328289f, 0.010001f, 0.244650f) + }, + + // 5 components + new[] + { + new Vector4(4.892608f, 1.685979f, -22.356787f, 85.91246f), + new Vector4(4.71187f, 4.998496f, 35.918936f, -28.875618f), + new Vector4(4.052795f, 8.244168f, -13.212253f, -1.578428f), + new Vector4(2.929212f, 11.900859f, 0.507991f, 1.816328f), + new Vector4(1.512961f, 16.116382f, 0.138051f, -0.01f) + }, + + // 6 components + new[] + { + new Vector4(5.143778f, 2.079813f, -82.326596f, 111.231024f), + new Vector4(5.612426f, 6.153387f, 113.878661f, 58.004879f), + new Vector4(5.982921f, 9.802895f, 39.479083f, -162.028887f), + new Vector4(6.505167f, 11.059237f, -71.286026f, 95.027069f), + new Vector4(3.869579f, 14.81052f, 1.405746f, -3.704914f), + new Vector4(2.201904f, 19.032909f, -0.152784f, -0.107988f) + } + }; + + /// + /// Gets the kernel parameters and scaling factor for the current count value in the current instance. + /// + private (Vector4[] Parameters, float Scale) GetParameters() + { + // Prepare the kernel components + int index = Math.Max(0, Math.Min(ComponentsCount - 1, KernelComponents.Count)); + return (KernelComponents[index], KernelScales[index]); + } + + /// + /// Creates the collection of complex 1D kernels with the specified parameters. + /// + private Complex64[][] CreateComplexKernels() + { + var kernels = new Complex64[KernelParameters.Length][]; + ref Vector4 baseRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); + for (int i = 0; i < KernelParameters.Length; i++) + { + ref Vector4 paramsRef = ref Unsafe.Add(ref baseRef, i); + kernels[i] = CreateComplex1DKernel(paramsRef.X, paramsRef.Y); + } + + return kernels; + } + + /// + /// Creates a complex 1D kernel with the specified parameters. + /// + /// The exponential parameter for each complex component. + /// The angle component for each complex component. + private Complex64[] CreateComplex1DKernel(float a, float b) + { + var kernel = new Complex64[KernelSize]; + ref Complex64 baseRef = ref MemoryMarshal.GetReference(kernel.AsSpan()); + int r = Radius, n = -r; + + for (int i = 0; i < KernelSize; i++, n++) + { + // Incrementally compute the range values + float value = n * KernelsScale * (1f / r); + value *= value; + + // Fill in the complex kernel values + Unsafe.Add(ref baseRef, i) = new Complex64( + MathF.Exp(-a * value) * MathF.Cos(b * value), + MathF.Exp(-a * value) * MathF.Sin(b * value)); + } + + return kernel; + } + + /// + /// Normalizes the kernels with respect to A * real + B * imaginary. + /// + private void NormalizeKernels() + { + // Calculate the complex weighted sum + float total = 0; + Span kernelsSpan = Kernels.AsSpan(); + ref Complex64[] baseKernelsRef = ref MemoryMarshal.GetReference(kernelsSpan); + ref Vector4 baseParamsRef = ref MemoryMarshal.GetReference(KernelParameters.AsSpan()); + + for (int i = 0; i < KernelParameters.Length; i++) + { + ref Complex64[] kernelRef = ref Unsafe.Add(ref baseKernelsRef, i); + int length = kernelRef.Length; + ref Complex64 valueRef = ref kernelRef[0]; + ref Vector4 paramsRef = ref Unsafe.Add(ref baseParamsRef, i); + + for (int j = 0; j < length; j++) { - ref Vector2 jRef = ref Unsafe.Add(ref valueRef, j); - ref Vector2 kRef = ref Unsafe.Add(ref valueRef, k); - total += - paramsRef.Z * (jRef.X * kRef.X - jRef.Y * kRef.Y) - + paramsRef.W * (jRef.X * kRef.Y + jRef.Y * kRef.X); + for (int k = 0; k < length; k++) + { + ref Complex64 jRef = ref Unsafe.Add(ref valueRef, j); + ref Complex64 kRef = ref Unsafe.Add(ref valueRef, k); + total += + paramsRef.Z * (jRef.Real * kRef.Real - jRef.Imaginary * kRef.Imaginary) + + paramsRef.W * (jRef.Real * kRef.Imaginary + jRef.Imaginary * kRef.Real); + } + } + } + + // Normalize the kernels + float scalar = 1f / MathF.Sqrt(total); + for (int i = 0; i < kernelsSpan.Length; i++) + { + ref Complex64[] kernelsRef = ref Unsafe.Add(ref baseKernelsRef, i); + int length = kernelsRef.Length; + ref Complex64 valueRef = ref kernelsRef[0]; + + for (int j = 0; j < length; j++) + { + Unsafe.Add(ref valueRef, j) *= scalar; } } } - // Normalize the kernels - float scalar = 1f / MathF.Sqrt(total); - for (int i = 0; i < kernelsSpan.Length; i++) + /// + protected override void OnFrameApply(ImageFrame source) { - ref Vector2[] kernelsRef = ref Unsafe.Add(ref baseKernelsRef, i); - int length = kernelsRef.Length; - ref Vector2 valueRef = ref kernelsRef[0]; - - for (int j = 0; j < length; j++) + if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) { - Unsafe.Add(ref valueRef, j) *= scalar; + ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); } - } - } - /// - protected override void OnFrameApply(ImageFrame source) - { - foreach (Memory memory in source.GetPixelMemoryGroup()) - { + Span span = MemoryMarshal.Cast(pixelSpan); + + using ReadWriteTexture2D texture = GraphicsDevice.AllocateReadWriteTexture2D(span, source.Width, source.Height); + using ReadWriteTexture2D temporary = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height, AllocationMode.Clear); + using ReadWriteTexture2D reals = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); + using ReadWriteTexture2D imaginaries = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); + using ReadOnlyBuffer kernel = GraphicsDevice.AllocateReadOnlyBuffer(KernelSize); + // Preliminary gamma highlight pass - using IMemoryOwner source4 = GetExposedVector4Buffer(memory); - - using ReadOnlyBuffer sourceBuffer = Gpu.Default.AllocateReadOnlyBuffer(source4.Memory.Span); - using ReadWriteBuffer processingBuffer = Gpu.Default.AllocateReadWriteBuffer(sourceBuffer.Size); - using ReadWriteBuffer firstPassBuffer = Gpu.Default.AllocateReadWriteBuffer(sourceBuffer.Size * 2); - using ReadOnlyBuffer kernelBuffer = Gpu.Default.AllocateReadOnlyBuffer(KernelSize); - - ref Vector4 param0 = ref KernelParameters[0]; // Avoid bounds check to access the kernel parameters + GraphicsDevice.For(source.Height, new(texture)); // Perform two 1D convolutions for each component in the current instance for (int j = 0; j < Kernels.Length; j++) { - kernelBuffer.SetData(Kernels[j]); - Vector4 parameters = Unsafe.Add(ref param0, j); + Vector4 parameters = KernelParameters[j]; - ApplyVerticalConvolution(sourceBuffer, firstPassBuffer, kernelBuffer); - ApplyHorizontalConvolutionAndAccumulatePartials(firstPassBuffer, processingBuffer, kernelBuffer, parameters.Z, parameters.W); + kernel.CopyFrom(Kernels[j]); + + GraphicsDevice.For( + source.Width, + source.Height, + new(texture, reals, imaginaries, kernel)); + + GraphicsDevice.For( + source.Width, + source.Height, + new(parameters.Z, parameters.W, reals, imaginaries, temporary, kernel)); } // Apply the inverse gamma exposure pass - processingBuffer.GetData(source4.Memory.Span); + GraphicsDevice.For(source.Height, new(temporary, texture)); // Write the final pixel data - ApplyInverseGammaExposure(source4.Memory, memory); + texture.CopyTo(span); } - } - /// - /// Performs a vertical 1D complex convolution with the specified parameters - /// - /// The source to read data from - /// The target to write the results to - /// The with the values for the current complex kernel - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void ApplyVerticalConvolution( - ReadOnlyBuffer source, - ReadWriteBuffer target, - ReadOnlyBuffer kernel) - { - int height = Source.Height; - int width = Source.Width; - - Gpu.Default.For(width, height, new VerticalConvolutionProcessor + /// + /// Kernel for the vertical convolution pass. + /// + [AutoConstructor] + internal partial struct VerticalConvolutionProcessor : IComputeShader { - width = width, - maxY = height - 1, - maxX = width - 1, - kernelLength = kernel.Size, - source = source, - target = target, - kernel = kernel - }); - } + public IReadWriteTexture2D source; + public ReadWriteTexture2D reals; + public ReadWriteTexture2D imaginaries; + public ReadOnlyBuffer kernel; - /// - /// Kernel for - /// - private struct VerticalConvolutionProcessor : IComputeShader - { - public int width; - public int maxY; - public int maxX; - public int kernelLength; - - public ReadOnlyBuffer source; - public ReadWriteBuffer target; - public ReadOnlyBuffer kernel; - - /// - public void Execute(ThreadIds ids) - { - Vector4 real = Vector4.Zero; - Vector4 imaginary = Vector4.Zero; - int radiusY = kernelLength >> 1; - int sourceOffsetColumnBase = ids.X; - - for (int i = 0; i < kernelLength; i++) + /// + public void Execute() { - int offsetY = Hlsl.Clamp(ids.Y + i - radiusY, 0, maxY); - int offsetX = Hlsl.Clamp(sourceOffsetColumnBase, 0, maxX); - Vector4 color = source[offsetY * width + offsetX]; - Vector2 factors = kernel[i]; + Vector4 real = Vector4.Zero; + Vector4 imaginary = Vector4.Zero; + int maxY = source.Height; + int maxX = source.Width; + int kernelLength = kernel.Length; + int radiusY = kernelLength >> 1; - real += factors.X * color; - imaginary += factors.Y * color; - } + for (int i = 0; i < kernelLength; i++) + { + int offsetY = Hlsl.Clamp(ThreadIds.Y + i - radiusY, 0, maxY); + int offsetX = Hlsl.Clamp(ThreadIds.X, 0, maxX); + Vector4 color = source[offsetX, offsetY]; + Complex64 factors = kernel[i]; - int offsetXY = ids.Y * width * 2 + ids.X * 2; - target[offsetXY] = real; - target[offsetXY + 1] = imaginary; - } - } + real += factors.Real * color; + imaginary += factors.Imaginary * color; + } - /// - /// Performs an horizontal 1D complex convolution with the specified parameters - /// - /// The source to read data from - /// The target to write the results to - /// The with the values for the current complex kernel - /// The weight factor for the real component of the complex pixel values - /// The weight factor for the imaginary component of the complex pixel values - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void ApplyHorizontalConvolutionAndAccumulatePartials( - ReadWriteBuffer source, - ReadWriteBuffer target, - ReadOnlyBuffer kernel, - float z, - float w) - { - int height = Source.Height; - int width = Source.Width; - - Gpu.Default.For(width, height, new HorizontalConvolutionAndAccumulatePartialsProcessor - { - width = width, - maxY = height - 1, - maxX = width - 1, - kernelLength = kernel.Size, - z = z, - w = w, - source = source, - target = target, - kernel = kernel - }); - } - - /// - /// Kernel for - /// - private struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader - { - public int width; - public int maxY; - public int maxX; - public int kernelLength; - public float z; - public float w; - - public ReadWriteBuffer source; - public ReadWriteBuffer target; - public ReadOnlyBuffer kernel; - - /// - public void Execute(ThreadIds ids) - { - Vector4 real = Vector4.Zero; - Vector4 imaginary = Vector4.Zero; - int radiusX = kernelLength >> 1; - int sourceOffsetColumnBase = ids.X; - int offsetY = Hlsl.Clamp(ids.Y, 0, maxY); - - for (int i = 0; i < kernelLength; i++) - { - int offsetX = Hlsl.Clamp(sourceOffsetColumnBase + i - radiusX, 0, maxX); - var offsetXY = offsetY * width * 2 + offsetX * 2; - Vector4 sourceReal = source[offsetXY]; - Vector4 sourceImaginary = source[offsetXY + 1]; - Vector2 factors = kernel[i]; - - real += factors.X * sourceReal - factors.Y * sourceImaginary; - imaginary += factors.X * sourceImaginary + factors.Y * sourceReal; - } - - target[ids.Y * width + ids.X] += real * z + imaginary * w; - } - } - - /// - /// Applies the gamma correction/highlight to the input pixel buffer and returns an instance with values. - /// - /// The source image - [Pure] - private IMemoryOwner GetExposedVector4Buffer(Memory source) - { - IMemoryOwner target = Configuration.MemoryAllocator.Allocate(source.Length); - - float exp = Gamma; - int width = Source.Width; - int height = source.Length / width; - - ParallelRowIterator.IterateRows( - Configuration, - new Rectangle(0, 0, width, height), - new GetExposedVector4BufferProcessor(width, exp, source, target.Memory, Configuration)); - - return target; - } - - /// - /// The processor for - /// - private readonly struct GetExposedVector4BufferProcessor : IRowOperation - { - private readonly int width; - private readonly float exp; - - private readonly Memory source; - private readonly Memory target; - private readonly Configuration configuration; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public GetExposedVector4BufferProcessor( - int width, - float exp, - Memory source, - Memory target, - Configuration configuration) - { - this.width = width; - this.exp = exp; - this.source = source; - this.target = target; - this.configuration = configuration; - } - - /// - public void Invoke(int y) - { - int offset = y * width; - - Span rowTPixel = source.Span.Slice(offset, width); - Span rowVector4 = target.Span.Slice(offset, width); - - PixelOperations.Instance.ToVector4(configuration, rowTPixel, rowVector4); - - foreach (ref Vector4 v in rowVector4) - { - v.X = MathF.Pow(v.X, exp); - v.Y = MathF.Pow(v.Y, exp); - v.Z = MathF.Pow(v.Z, exp); + reals[ThreadIds.XY] = real; + imaginaries[ThreadIds.XY] = imaginary; } } - } - /// - /// Applies the inverse gamma exposure pass to compute the final pixel values for a target image - /// - /// The source buffer to read from - /// The target image - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void ApplyInverseGammaExposure(Memory source, Memory target) - { - int width = Source.Width; - int height = source.Length / width; - float expGamma = 1 / Gamma; - - ParallelRowIterator.IterateRows( - Configuration, - new Rectangle(0, 0, width, height), - new ApplyInverseGammaExposureProcessor(width, expGamma, source, target, Configuration)); - } - - /// - /// The processor for - /// - private readonly struct ApplyInverseGammaExposureProcessor : IRowOperation - { - private readonly int width; - private readonly float exp; - - private readonly Memory source; - private readonly Memory target; - private readonly Configuration configuration; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public ApplyInverseGammaExposureProcessor( - int width, - float exp, - Memory source, - Memory target, - Configuration configuration) + /// + /// Kernel for the horizontal convolution pass. + /// + [AutoConstructor] + internal partial struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader { - this.width = width; - this.exp = exp; - this.source = source; - this.target = target; - this.configuration = configuration; + public float z; + public float w; + + public ReadWriteTexture2D reals; + public ReadWriteTexture2D imaginaries; + public ReadWriteTexture2D target; + public ReadOnlyBuffer kernel; + + /// + public void Execute() + { + Vector4 real = Vector4.Zero; + Vector4 imaginary = Vector4.Zero; + int maxY = target.Height; + int maxX = target.Width; + int kernelLength = kernel.Length; + int radiusX = kernelLength >> 1; + int offsetY = Hlsl.Clamp(ThreadIds.Y, 0, maxY); + + for (int i = 0; i < kernelLength; i++) + { + int offsetX = Hlsl.Clamp(ThreadIds.X + i - radiusX, 0, maxX); + Vector4 sourceReal = reals[offsetX, offsetY]; + Vector4 sourceImaginary = imaginaries[offsetX, offsetY]; + Complex64 factors = kernel[i]; + + real += factors.Real * sourceReal - factors.Imaginary * sourceImaginary; + imaginary += factors.Real * sourceImaginary + factors.Imaginary * sourceReal; + } + + target[ThreadIds.XY] += real * z + imaginary * w; + } } - /// - public void Invoke(int y) + /// + /// Kernel for the gamma highlight pass. + /// + [AutoConstructor] + internal readonly partial struct GammaHighlightProcessor : IComputeShader { - int offset = y * width; + public readonly IReadWriteTexture2D source; - Span rowVector4 = source.Span.Slice(offset, width); - Span rowTPixel = target.Span.Slice(offset, width); - - Vector4 low = Vector4.Zero; - var high = new Vector4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity); - - foreach (ref Vector4 v in rowVector4) + /// + public void Execute() { - var clamp = Vector4.Clamp(v, low, high); - v.X = MathF.Pow(clamp.X, exp); - v.Y = MathF.Pow(clamp.Y, exp); - v.Z = MathF.Pow(clamp.Z, exp); - } + int width = source.Width; - PixelOperations.Instance.FromVector4Destructive(configuration, rowVector4, rowTPixel); + for (int i = 0; i < width; i++) + { + Float4 v = source[i, ThreadIds.X]; + + v.XYZ = v.XYZ * v.XYZ * v.XYZ; + + source[i, ThreadIds.X] = v; + } + } + } + + /// + /// Kernel for the inverse gamma highlight pass. + /// + [AutoConstructor] + internal readonly partial struct InverseGammaHighlightProcessor : IComputeShader + { + public readonly ReadWriteTexture2D source; + public readonly IReadWriteTexture2D target; + + /// + public void Execute() + { + int width = source.Width; + + for (int i = 0; i < width; i++) + { + Float4 v = source[i, ThreadIds.X]; + + v = Hlsl.Clamp(v, 0, float.MaxValue); + v.XYZ = Hlsl.Pow(v.XYZ, 1 / 3f); + + target[i, ThreadIds.X] = v; + } + } } } } diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs index d628edad..159e1965 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.cs @@ -1,13 +1,16 @@ -using SixLabors.ImageSharp; +using System.Runtime.CompilerServices; +using Microsoft.Toolkit.Diagnostics; +using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; namespace ComputeSharp.BokehBlur.Processors { /// - /// Defines Gaussian blur by a (Sigma, Radius) pair + /// Defines Gaussian blur by a (Sigma, Radius) pair. /// - public sealed class HlslGaussianBlurProcessor : IImageProcessor + public sealed partial class HlslGaussianBlurProcessor : IImageProcessor { /// /// The default value for . @@ -15,34 +18,57 @@ namespace ComputeSharp.BokehBlur.Processors public const float DefaultSigma = 3f; /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class. /// - public HlslGaussianBlurProcessor() : this(DefaultSigma, 9) { } - - /// - /// Initializes a new instance of the class - /// - /// The radius value representing the size of the area to sample - public HlslGaussianBlurProcessor(int radius) : this(radius / 3F, radius) { } - - /// - /// Initializes a new instance of the class - /// - /// The sigma value representing the weight of the blur - /// The radius value representing the size of the area to sample (this should be at least twice the sigma value) - public HlslGaussianBlurProcessor(float sigma, int radius) + public HlslGaussianBlurProcessor() + : this(Gpu.Default, DefaultSigma, 9) { + } + + /// + /// Initializes a new instance of the class. + /// + /// The radius value representing the size of the area to sample. + public HlslGaussianBlurProcessor(int radius) + : this(Gpu.Default, radius / 3F, radius) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The associated with the current instance. + /// The radius value representing the size of the area to sample. + public HlslGaussianBlurProcessor(GraphicsDevice device, int radius) + : this(device, radius / 3F, radius) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The associated with the current instance. + /// The sigma value representing the weight of the blur. + /// The radius value representing the size of the area to sample (this should be at least twice the sigma value) + public HlslGaussianBlurProcessor(GraphicsDevice device, float sigma, int radius) + { + GraphicsDevice = device; Sigma = sigma; Radius = radius; } /// - /// Gets the sigma value representing the weight of the blur + /// The instance in use. + /// + private readonly GraphicsDevice GraphicsDevice; + + /// + /// Gets the sigma value representing the weight of the blur. /// public float Sigma { get; } /// - /// Gets the radius defining the size of the area to sample + /// Gets the radius defining the size of the area to sample. /// public int Radius { get; } @@ -50,7 +76,14 @@ namespace ComputeSharp.BokehBlur.Processors public IImageProcessor CreatePixelSpecificProcessor(Configuration configuration, Image source, Rectangle sourceRectangle) where TPixel : unmanaged, IPixel { - return new HlslGaussianBlurProcessor(this, configuration, source, sourceRectangle); + if (typeof(TPixel) != typeof(ImageSharpRgba32)) + { + ThrowHelper.ThrowInvalidOperationException("This processor only supports the RGBA32 pixel format"); + } + + var processor = new Implementation(this, configuration, Unsafe.As>(source), sourceRectangle); + + return Unsafe.As>(processor); } } } diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs index 1cd556b2..e3b5a7c4 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor{TPixel}.cs @@ -1,237 +1,178 @@ using System; -using System.Buffers; using System.Numerics; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Microsoft.Toolkit.Diagnostics; using SixLabors.ImageSharp; -using SixLabors.ImageSharp.Advanced; -using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing.Processors; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; namespace ComputeSharp.BokehBlur.Processors { - /// - /// Applies Gaussian blur processing to an image. - /// - /// The pixel format. - internal class HlslGaussianBlurProcessor : ImageProcessor - where TPixel : unmanaged, IPixel + /// + public sealed partial class HlslGaussianBlurProcessor { /// - /// The 1D kernel to apply + /// Applies Gaussian blur processing to an image. /// - private readonly float[] Kernel; - - /// - /// Initializes a new instance of the class - /// - /// The defining the processor parameters - /// The configuration which allows altering default behaviour or extending the library - /// The source for the current processor instance - /// The source area to process for the current processor instance - public HlslGaussianBlurProcessor(HlslGaussianBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) - : base(configuration, source, sourceRectangle) + internal sealed partial class Implementation : ImageProcessor { - int kernelSize = definition.Radius * 2 + 1; - Kernel = CreateGaussianBlurKernel(kernelSize, definition.Sigma); - } + /// + /// The instance in use. + /// + private readonly GraphicsDevice GraphicsDevice; - /// - /// Creates a 1 dimensional Gaussian kernel using the Gaussian G(x) function - /// - private static float[] CreateGaussianBlurKernel(int size, float weight) - { - float[] kernel = new float[size]; - ref float rKernel = ref kernel[0]; + /// + /// The 1D kernel to apply. + /// + private readonly float[] Kernel; - float sum = 0F; - float midpoint = (size - 1) / 2F; - - for (int i = 0; i < size; i++) + /// + /// Initializes a new instance of the class. + /// + /// The defining the processor parameters. + /// The configuration which allows altering default behaviour or extending the library. + /// The source for the current processor instance. + /// The source area to process for the current processor instance. + public Implementation(HlslGaussianBlurProcessor definition, Configuration configuration, Image source, Rectangle sourceRectangle) + : base(configuration, source, sourceRectangle) { - float x = i - midpoint; - float gx = Gaussian(x, weight); - sum += gx; - Unsafe.Add(ref rKernel, i) = gx; + int kernelSize = definition.Radius * 2 + 1; + + GraphicsDevice = definition.GraphicsDevice; + Kernel = CreateGaussianBlurKernel(kernelSize, definition.Sigma); } - // Normalize kernel so that the sum of all weights equals 1 - for (int i = 0; i < size; i++) + /// + /// Creates a 1 dimensional Gaussian kernel using the Gaussian G(x) function. + /// + private static float[] CreateGaussianBlurKernel(int size, float weight) { - Unsafe.Add(ref rKernel, i) /= sum; - } + float[] kernel = new float[size]; + ref float rKernel = ref kernel[0]; - return kernel; - } + float sum = 0F; + float midpoint = (size - 1) / 2F; - /// - /// Implementation of 1D Gaussian G(x) function - /// - /// The x provided to G(x) - /// The spread of the blur - /// The Gaussian G(x) - private static float Gaussian(float x, float sigma) - { - const float Numerator = 1.0f; - float denominator = MathF.Sqrt(2 * MathF.PI) * sigma; - - float exponentNumerator = -x * x; - float exponentDenominator = 2 * sigma * sigma; - - float left = Numerator / denominator; - float right = MathF.Exp(exponentNumerator / exponentDenominator); - - return left * right; - } - - /// - protected override void OnFrameApply(ImageFrame source) - { - foreach (Memory memory in source.GetPixelMemoryGroup()) - { - Span spanTPixel = memory.Span; - - using IMemoryOwner group4 = Configuration.MemoryAllocator.Allocate(spanTPixel.Length); - - Span spanVector4 = group4.Memory.Span; - - PixelOperations.Instance.ToVector4(Configuration, spanTPixel, spanVector4); - - using ReadWriteBuffer sourceBuffer = Gpu.Default.AllocateReadWriteBuffer(spanVector4); - using ReadWriteBuffer firstPassBuffer = Gpu.Default.AllocateReadWriteBuffer(sourceBuffer.Size); - using ReadOnlyBuffer kernelBuffer = Gpu.Default.AllocateReadOnlyBuffer(Kernel); - - ApplyVerticalConvolution(sourceBuffer, firstPassBuffer, kernelBuffer); - ApplyHorizontalConvolution(firstPassBuffer, sourceBuffer, kernelBuffer); - - sourceBuffer.GetData(spanVector4); - - PixelOperations.Instance.FromVector4Destructive(Configuration, spanVector4, spanTPixel); - } - } - - /// - /// Performs a vertical 1D complex convolution with the specified parameters - /// - /// The source to read data from - /// The target to write the results to - /// The with the values for the current complex kernel - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void ApplyVerticalConvolution( - ReadWriteBuffer source, - ReadWriteBuffer target, - ReadOnlyBuffer kernel) - { - int height = Source.Height; - int width = Source.Width; - - Gpu.Default.For(width, height, new VerticalConvolutionProcessor - { - width = width, - maxY = height - 1, - maxX = width - 1, - kernelLength = kernel.Size, - source = source, - target = target, - kernel = kernel - }); - } - - /// - /// Kernel for - /// - private struct VerticalConvolutionProcessor : IComputeShader - { - public int width; - public int maxY; - public int maxX; - public int kernelLength; - - public ReadWriteBuffer source; - public ReadWriteBuffer target; - public ReadOnlyBuffer kernel; - - /// - public void Execute(ThreadIds ids) - { - Vector4 result = Vector4.Zero; - int radiusY = kernelLength >> 1; - int sourceOffsetColumnBase = ids.X; - - for (int i = 0; i < kernelLength; i++) + for (int i = 0; i < size; i++) { - int offsetY = Hlsl.Clamp(ids.Y + i - radiusY, 0, maxY); - int offsetX = Hlsl.Clamp(sourceOffsetColumnBase, 0, maxX); - Vector4 color = source[offsetY * width + offsetX]; - - result += kernel[i] * color; + float x = i - midpoint; + float gx = Gaussian(x, weight); + sum += gx; + Unsafe.Add(ref rKernel, i) = gx; } - int offsetXY = ids.Y * width + ids.X; - target[offsetXY] = result; - } - } - - /// - /// Performs an horizontal 1D complex convolution with the specified parameters - /// - /// The source to read data from - /// The target to write the results to - /// The with the values for the current complex kernel - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void ApplyHorizontalConvolution( - ReadWriteBuffer source, - ReadWriteBuffer target, - ReadOnlyBuffer kernel) - { - int height = Source.Height; - int width = Source.Width; - - Gpu.Default.For(width, height, new HorizontalConvolutionProcessor - { - width = width, - maxY = height - 1, - maxX = width - 1, - kernelLength = kernel.Size, - source = source, - target = target, - kernel = kernel - }); - } - - /// - /// Kernel for - /// - private struct HorizontalConvolutionProcessor : IComputeShader - { - public int width; - public int maxY; - public int maxX; - public int kernelLength; - - public ReadWriteBuffer source; - public ReadWriteBuffer target; - public ReadOnlyBuffer kernel; - - /// - public void Execute(ThreadIds ids) - { - Vector4 result = Vector4.Zero; - int radiusX = kernelLength >> 1; - int sourceOffsetColumnBase = ids.X; - int offsetY = Hlsl.Clamp(ids.Y, 0, maxY); - int offsetXY; - - for (int i = 0; i < kernelLength; i++) + // Normalize kernel so that the sum of all weights equals 1 + for (int i = 0; i < size; i++) { - int offsetX = Hlsl.Clamp(sourceOffsetColumnBase + i - radiusX, 0, maxX); - offsetXY = offsetY * width + offsetX; - Vector4 color = source[offsetXY]; - - result += kernel[i] * color; + Unsafe.Add(ref rKernel, i) /= sum; } - offsetXY = ids.Y * width + ids.X; - target[offsetXY] = result; + return kernel; + } + + /// + /// Implementation of 1D Gaussian G(x) function. + /// + /// The x provided to G(x) + /// The spread of the blur. + /// The Gaussian G(x) + private static float Gaussian(float x, float sigma) + { + const float Numerator = 1.0f; + float denominator = MathF.Sqrt(2 * MathF.PI) * sigma; + + float exponentNumerator = -x * x; + float exponentDenominator = 2 * sigma * sigma; + + float left = Numerator / denominator; + float right = MathF.Exp(exponentNumerator / exponentDenominator); + + return left * right; + } + + /// + protected override void OnFrameApply(ImageFrame source) + { + if (!source.TryGetSinglePixelSpan(out Span pixelSpan)) + { + ThrowHelper.ThrowInvalidOperationException("Cannot process image frames wrapping discontiguous memory"); + } + + Span span = MemoryMarshal.Cast(pixelSpan); + + using ReadWriteTexture2D sourceTexture = GraphicsDevice.AllocateReadWriteTexture2D(span, source.Width, source.Height); + using ReadWriteTexture2D firstPassTexture = GraphicsDevice.AllocateReadWriteTexture2D(source.Width, source.Height); + using ReadOnlyBuffer kernelBuffer = GraphicsDevice.AllocateReadOnlyBuffer(Kernel); + + GraphicsDevice.For(source.Width, source.Height, new(sourceTexture, firstPassTexture, kernelBuffer)); + GraphicsDevice.For(source.Width, source.Height, new(firstPassTexture, sourceTexture, kernelBuffer)); + + sourceTexture.CopyTo(span); + } + + /// + /// Kernel for the vertical convolution pass. + /// + [AutoConstructor] + internal readonly partial struct VerticalConvolutionProcessor : IComputeShader + { + public readonly IReadWriteTexture2D source; + public readonly IReadWriteTexture2D target; + public readonly ReadOnlyBuffer kernel; + + /// + public void Execute() + { + Vector4 result = Vector4.Zero; + int maxY = source.Height - 1; + int maxX = source.Width - 1; + int kernelLength = kernel.Length; + int radiusY = kernelLength >> 1; + + for (int i = 0; i < kernelLength; i++) + { + int offsetY = Hlsl.Clamp(ThreadIds.Y + i - radiusY, 0, maxY); + int offsetX = Hlsl.Clamp(ThreadIds.X, 0, maxX); + Vector4 color = source[offsetX, offsetY]; + + result += kernel[i] * color; + } + + target[ThreadIds.XY] = result; + } + } + + /// + /// Kernel for the horizontal convolution pass. + /// + [AutoConstructor] + internal readonly partial struct HorizontalConvolutionProcessor : IComputeShader + { + public readonly IReadWriteTexture2D source; + public readonly IReadWriteTexture2D target; + public readonly ReadOnlyBuffer kernel; + + /// + public void Execute() + { + Vector4 result = Vector4.Zero; + int maxY = source.Height - 1; + int maxX = source.Width - 1; + int kernelLength = kernel.Length; + int radiusX = kernelLength >> 1; + int offsetY = Hlsl.Clamp(ThreadIds.Y, 0, maxY); + + for (int i = 0; i < kernelLength; i++) + { + int offsetX = Hlsl.Clamp(ThreadIds.X + i - radiusX, 0, maxX); + Vector4 color = source[offsetX, offsetY]; + + result += kernel[i] * color; + } + + target[ThreadIds.XY] = result; + } } } } diff --git a/samples/ComputeSharp.ImageProcessing/Program.cs b/samples/ComputeSharp.ImageProcessing/Program.cs index 91f52ca5..ded812cd 100644 --- a/samples/ComputeSharp.ImageProcessing/Program.cs +++ b/samples/ComputeSharp.ImageProcessing/Program.cs @@ -5,6 +5,7 @@ using ComputeSharp.BokehBlur.Processors; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; namespace ComputeSharp.ImageProcessing { @@ -13,13 +14,13 @@ namespace ComputeSharp.ImageProcessing static void Main() { Console.WriteLine(">> Loading image"); - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "city.jpg"); - using Image image = Image.Load(path); + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "city.jpg"); + using Image image = Image.Load(path); // Apply a series of processors and save the results foreach (var effect in new (string Name, IImageProcessor Processor)[] { - ("bokeh", new HlslBokehBlurProcessor(80, 2, 3)), + ("bokeh", new HlslBokehBlurProcessor(80, 2)), ("gaussian", new HlslGaussianBlurProcessor(80)) }) { @@ -28,7 +29,7 @@ namespace ComputeSharp.ImageProcessing Console.WriteLine($">> Saving {effect.Name} to disk"); string targetPath = Path.Combine( - Path.GetRelativePath(Path.GetDirectoryName(path), @"..\..\..\"), + Path.GetRelativePath(Path.GetDirectoryName(path)!, @"..\..\..\"), $"{Path.GetFileNameWithoutExtension(path)}_{effect.Name}{Path.GetExtension(path)}"); copy.Save(targetPath); } diff --git a/samples/ComputeSharp.Sample.Local/ComputeSharp.Sample.Local.csproj b/samples/ComputeSharp.Sample.Local/ComputeSharp.Sample.Local.csproj new file mode 100644 index 00000000..7c96952c --- /dev/null +++ b/samples/ComputeSharp.Sample.Local/ComputeSharp.Sample.Local.csproj @@ -0,0 +1,18 @@ + + + + Exe + net5.0 + + + + + + + + + + diff --git a/samples/ComputeSharp.Sample.NuGet/ComputeSharp.Sample.NuGet.csproj b/samples/ComputeSharp.Sample.NuGet/ComputeSharp.Sample.NuGet.csproj new file mode 100644 index 00000000..bdf283bf --- /dev/null +++ b/samples/ComputeSharp.Sample.NuGet/ComputeSharp.Sample.NuGet.csproj @@ -0,0 +1,14 @@ + + + + Exe + net5.0 + + + + + + + + + diff --git a/samples/ComputeSharp.Sample.Shared/ComputeSharp.Sample.Shared.projitems b/samples/ComputeSharp.Sample.Shared/ComputeSharp.Sample.Shared.projitems new file mode 100644 index 00000000..f30f1996 --- /dev/null +++ b/samples/ComputeSharp.Sample.Shared/ComputeSharp.Sample.Shared.projitems @@ -0,0 +1,14 @@ + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + true + 8cefc324-ca6c-4845-9ad9-70b92bd87057 + + + ComputeSharp.Sample.Shared + + + + + \ No newline at end of file diff --git a/samples/ComputeSharp.Sample.Shared/ComputeSharp.Sample.Shared.shproj b/samples/ComputeSharp.Sample.Shared/ComputeSharp.Sample.Shared.shproj new file mode 100644 index 00000000..51735cd3 --- /dev/null +++ b/samples/ComputeSharp.Sample.Shared/ComputeSharp.Sample.Shared.shproj @@ -0,0 +1,13 @@ + + + + 8cefc324-ca6c-4845-9ad9-70b92bd87057 + 14.0 + + + + + + + + diff --git a/samples/ComputeSharp.Sample/Program.cs b/samples/ComputeSharp.Sample.Shared/Program.cs similarity index 54% rename from samples/ComputeSharp.Sample/Program.cs rename to samples/ComputeSharp.Sample.Shared/Program.cs index 5d2cfcf5..ee01f2a1 100644 --- a/samples/ComputeSharp.Sample/Program.cs +++ b/samples/ComputeSharp.Sample.Shared/Program.cs @@ -5,7 +5,7 @@ using System.Runtime.CompilerServices; namespace ComputeSharp.Sample { - class Program + partial class Program { static void Main() { @@ -18,58 +18,50 @@ namespace ComputeSharp.Sample array[i] = i + 1; } - // Print the initial matrix - Console.WriteLine("===================== BEFORE ====================="); - PrintMatrix(array, width, height); - Console.WriteLine("=================================================="); - Console.WriteLine(); - using ReadWriteBuffer gpuBuffer = Gpu.Default.AllocateReadWriteBuffer(array); // Run the shader - Gpu.Default.For(100, new MainKernel(width, gpuBuffer)); + Gpu.Default.For(100, new MainKernel(gpuBuffer)); + + // Print the initial matrix + PrintMatrix(array, width, height, "BEFORE"); // Get the data back - gpuBuffer.GetData(array); + gpuBuffer.CopyTo(array); // Print the updated matrix - Console.WriteLine("===================== AFTER ======================"); - PrintMatrix(array, width, height); - Console.WriteLine("=================================================="); + PrintMatrix(array, width, height, "AFTER"); } /// - /// Kernel for + /// Kernel for . /// - private readonly struct MainKernel : IComputeShader + [AutoConstructor] + internal readonly partial struct MainKernel : IComputeShader { - private readonly int width; - - private readonly ReadWriteBuffer buffer; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public MainKernel(int width, ReadWriteBuffer buffer) - { - this.width = width; - this.buffer = buffer; - } + public readonly ReadWriteBuffer buffer; /// - public void Execute(ThreadIds ids) + public void Execute() { - int offset = ids.X + ids.Y * width; - buffer[offset] *= 2; + buffer[ThreadIds.X] *= 2; } } /// - /// Prints a matrix in a properly formatted way + /// Prints a matrix in a properly formatted way. /// - /// The input array representing the matrix to print - /// The width of the array to print - /// The height of the array to print - private static void PrintMatrix(float[] array, int width, int height) + /// The input array representing the matrix to print. + /// The width of the array to print. + /// The height of the array to print. + /// The name of the matrix to print. + private static void PrintMatrix(float[] array, int width, int height, string name) { + int pad = 48 - name.Length; + string title = $"{new string('=', pad / 2)} {name} {new string('=', (pad + 1) / 2)}"; + + Console.WriteLine(title); + int length = width * height; int numberWidth = array.Max().ToString(CultureInfo.InvariantCulture).Length; ref float r = ref array[0]; @@ -82,6 +74,8 @@ namespace ComputeSharp.Sample if (i < length - 1) Console.Write(", "); if (i > 0 && (i + 1) % width == 0) Console.WriteLine(); } + + Console.WriteLine(new string('=', 50)); } } } diff --git a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj b/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj deleted file mode 100644 index 430f758a..00000000 --- a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - netcoreapp3.1 - - - - - - - diff --git a/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs new file mode 100644 index 00000000..3340a9dd --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs @@ -0,0 +1,287 @@ +using System; +using System.Drawing; +using ComputeSharp.Interop; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp.SwapChain.Backend +{ + internal sealed class SwapChainApplication : Win32Application + where T : struct, IComputeShader + { + /// + /// The instance used to create shaders to run. + /// + private readonly Func, TimeSpan, T> shaderFactory; + + /// + /// The pointer for the device currently in use. + /// + private ComPtr d3D12Device; + + /// + /// The instance to use for graphics operations. + /// + private ComPtr d3D12CommandQueue; + + /// + /// The instance used for graphics operations. + /// + private ComPtr d3D12Fence; + + /// + /// The next fence value for graphics operations using . + /// + private ulong nextD3D12FenceValue = 1; + + /// + /// The object to create command lists. + /// + private ComPtr d3D12CommandAllocator; + + /// + /// The instance used to copy data to the back buffers. + /// + private ComPtr d3D12GraphicsCommandList; + + /// + /// The instance used to display content onto the target window. + /// + private ComPtr dxgiSwapChain1; + + /// + /// The first buffer within . + /// + private ComPtr d3D12Resource0; + + /// + /// The second buffer within . + /// + private ComPtr d3D12Resource1; + + /// + /// The index of the next buffer that can be used to present content. + /// + private uint currentBufferIndex; + + /// + /// The instance used to prepare frames to display. + /// + private ReadWriteTexture2D? texture; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance used to create shaders to run. + public SwapChainApplication(Func, TimeSpan, T> shaderFactory) + { + this.shaderFactory = shaderFactory; + } + + /// + public override string Title => default(T).ToString()!; + + /// + public override unsafe void OnInitialize(Size size, HWND hwnd) + { + // Get the underlying ID3D12Device in use + fixed (ID3D12Device** d3D12Device = this.d3D12Device) + { + _ = InteropServices.TryGetID3D12Device(Gpu.Default, FX.__uuidof(), (void**)d3D12Device); + } + + // Create the direct command queue to use + fixed (ID3D12CommandQueue** d3D12CommandQueue = this.d3D12CommandQueue) + { + D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; + d3D12CommandQueueDesc.Type = D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT; + d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY.D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; + d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAGS.D3D12_COMMAND_QUEUE_FLAG_NONE; + d3D12CommandQueueDesc.NodeMask = 0; + + _ = d3D12Device.Get()->CreateCommandQueue( + &d3D12CommandQueueDesc, + FX.__uuidof(), + (void**)d3D12CommandQueue); + } + + // Create the direct fence + fixed (ID3D12Fence** d3D12Fence = this.d3D12Fence) + { + _ = this.d3D12Device.Get()->CreateFence( + 0, + D3D12_FENCE_FLAGS.D3D12_FENCE_FLAG_NONE, + FX.__uuidof(), + (void**)d3D12Fence); + } + + // Create the swap chain to display frames + fixed (IDXGISwapChain1** dxgiSwapChain1 = this.dxgiSwapChain1) + { + using ComPtr dxgiFactory2 = default; + + _ = FX.CreateDXGIFactory2(FX.DXGI_CREATE_FACTORY_DEBUG, FX.__uuidof(), (void**)dxgiFactory2.GetAddressOf()); + + DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc1 = default; + dxgiSwapChainDesc1.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; + dxgiSwapChainDesc1.BufferCount = 2; + dxgiSwapChainDesc1.Flags = 0; + dxgiSwapChainDesc1.Format = DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM; + dxgiSwapChainDesc1.Width = 0; + dxgiSwapChainDesc1.Height = 0; + dxgiSwapChainDesc1.SampleDesc = new DXGI_SAMPLE_DESC(count: 1, quality: 0); + dxgiSwapChainDesc1.Scaling = DXGI_SCALING.DXGI_SCALING_STRETCH; + dxgiSwapChainDesc1.Stereo = 0; + dxgiSwapChainDesc1.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; + + _ = dxgiFactory2.Get()->CreateSwapChainForHwnd( + (IUnknown*)d3D12CommandQueue.Get(), + hwnd, + &dxgiSwapChainDesc1, + null, + null, + dxgiSwapChain1); + } + + // Create the command allocator to use + fixed (ID3D12CommandAllocator** d3D12CommandAllocator = this.d3D12CommandAllocator) + { + this.d3D12Device.Get()->CreateCommandAllocator( + D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, + FX.__uuidof(), + (void**)d3D12CommandAllocator); + } + + // Create the reusable command list to copy data to the back buffers + fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList) + { + this.d3D12Device.Get()->CreateCommandList( + 0, + D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, + d3D12CommandAllocator, + null, + FX.__uuidof(), + (void**)d3D12GraphicsCommandList); + } + + // Close the command list to prepare it for future use + this.d3D12GraphicsCommandList.Get()->Close(); + } + + /// + public override unsafe void OnResize(Size size) + { + this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); + + // Wait for the fence again to ensure there are no pending operations + this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); + + this.nextD3D12FenceValue++; + + // Dispose the old buffers before resizing the buffer + this.d3D12Resource0.Dispose(); + this.d3D12Resource1.Dispose(); + + // Resize the swap chain buffers + this.dxgiSwapChain1.Get()->ResizeBuffers(0, 0, 0, DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, 0); + + // Get the index of the initial back buffer + using (ComPtr dxgiSwapChain3 = default) + { + _ = this.dxgiSwapChain1.CopyTo(dxgiSwapChain3.GetAddressOf()); + + this.currentBufferIndex = dxgiSwapChain3.Get()->GetCurrentBackBufferIndex(); + } + + // Retrieve the back buffers for the swap chain + fixed (ID3D12Resource** d3D12Resource0 = this.d3D12Resource0) + fixed (ID3D12Resource** d3D12Resource1 = this.d3D12Resource1) + { + _ = dxgiSwapChain1.Get()->GetBuffer(0, FX.__uuidof(), (void**)d3D12Resource0); + _ = dxgiSwapChain1.Get()->GetBuffer(1, FX.__uuidof(), (void**)d3D12Resource1); + } + + this.texture?.Dispose(); + + D3D12_RESOURCE_DESC d3D12Resource0Description = this.d3D12Resource0.Get()->GetDesc(); + + // Create the 2D texture to use to generate frames to display + this.texture = Gpu.Default.AllocateReadWriteTexture2D( + (int)d3D12Resource0Description.Width, + (int)d3D12Resource0Description.Height); + } + + /// + public override unsafe void OnUpdate(TimeSpan time) + { + // Generate the new frame + Gpu.Default.For(this.texture!.Width, this.texture.Height, this.shaderFactory(this.texture, time)); + + using ComPtr d3D12Resource = default; + + // Get the underlying ID3D12Resource pointer for the texture + _ = InteropServices.TryGetID3D12Resource(this.texture, FX.__uuidof(), (void**)d3D12Resource.GetAddressOf()); + + // Get the target back buffer to update + ID3D12Resource* d3D12ResourceBackBuffer = this.currentBufferIndex switch + { + 0 => this.d3D12Resource0.Get(), + 1 => this.d3D12Resource1.Get(), + _ => null + }; + + this.currentBufferIndex ^= 1; + + // Reset the command list and command allocator + this.d3D12CommandAllocator.Get()->Reset(); + this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null); + + D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[] + { + D3D12_RESOURCE_BARRIER.InitTransition( + d3D12Resource.Get(), + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE), + D3D12_RESOURCE_BARRIER.InitTransition( + d3D12ResourceBackBuffer, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST) + }; + + // Transition the resources to COPY_DEST and COPY_SOURCE respectively + d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); + + // Copy the generated frame to the target back buffer + d3D12GraphicsCommandList.Get()->CopyResource(d3D12ResourceBackBuffer, d3D12Resource.Get()); + + d3D12ResourceBarriers[0] = D3D12_RESOURCE_BARRIER.InitTransition( + d3D12Resource.Get(), + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS); + + d3D12ResourceBarriers[1] = D3D12_RESOURCE_BARRIER.InitTransition( + d3D12ResourceBackBuffer, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST, + D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON); + + // Transition the resources back to COMMON and UNORDERED_ACCESS respectively + d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); + + d3D12GraphicsCommandList.Get()->Close(); + + // Execute the command list to perform the copy + this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)d3D12GraphicsCommandList.GetAddressOf()); + this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); + + // Present the new frame + this.dxgiSwapChain1.Get()->Present(0, 0); + + if (this.nextD3D12FenceValue > this.d3D12Fence.Get()->GetCompletedValue()) + { + this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); + } + + this.nextD3D12FenceValue++; + } + } +} diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs new file mode 100644 index 00000000..733a64ed --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs @@ -0,0 +1,36 @@ +using System; +using System.Drawing; +using TerraFX.Interop; + +namespace ComputeSharp.SwapChain.Backend +{ + /// + /// A class representing a simple Win32 application. + /// + internal abstract class Win32Application + { + /// + /// Gets the title of the current application. + /// + public abstract string Title { get; } + + /// + /// Initializes the current application. + /// + /// The window size. + /// The handle for the window. + public abstract void OnInitialize(Size size, HWND hwnd); + + /// + /// Resizes the current application. + /// + /// The new window size. + public abstract void OnResize(Size size); + + /// + /// Updates the current application. + /// + /// The current time since the start of the application. + public abstract void OnUpdate(TimeSpan time); + } +} diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs new file mode 100644 index 00000000..e7ca1c7a --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs @@ -0,0 +1,345 @@ +using System; +using System.Diagnostics; +using System.Drawing; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Threading; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp.SwapChain.Backend +{ + /// + /// A helper class to manage the creation and execution of Win32 applications. + /// + internal unsafe static class Win32ApplicationRunner + { + /// + /// Whether or not a resize operation is in progress. + /// + private static bool isResizing = false; + + /// + /// Whether or not the application is currently paused. + /// + private static bool isPaused = false; + + /// + /// The for the application window. + /// + private static HWND hwnd; + + /// + /// The current size of the application window. + /// + private static Size windowSize; + + /// + /// A instance used to track the elapsed time for the application. + /// + private static Stopwatch stopwatch = null!; + + /// + /// The application being run. + /// + private static Win32Application application = null!; + + /// + /// The number of elapsed milliseconds since the window title was last updated. + /// + private static long elapsedMillisecondsForLastTitleUpdate; + + /// + /// The number of elapsed frames since the window title was last updated. + /// + private static int elapsedFramesSinceLastTitleUpdate; + + /// + /// Runs a specified application and starts the main loop to update its state. + /// This is the entry point for a given application of type , and it should be + /// called as soon as the process is launched, excluding any other additional initialization needed. + /// To launch an application, simply add this line to the project being used: + /// Win32ApplicationRunner.Run<MyApplication>(); + /// + /// The type of application being launched. + /// The exit code for the application. + public static int Run(Win32Application application) + { + Win32ApplicationRunner.application = application; + + IntPtr hInstance = FX.GetModuleHandleW(null); + uint width = 1280; + uint height = 720; + + fixed (char* name = Assembly.GetExecutingAssembly().FullName) + fixed (char* windowTitle = application.Title) + { + // Initialize the window class + WNDCLASSEXW windowClassEx = new() + { + cbSize = (uint)sizeof(WNDCLASSEXW), + style = FX.CS_HREDRAW | FX.CS_VREDRAW, + lpfnWndProc = &WindowProc, + hInstance = hInstance, + hCursor = FX.LoadCursorW(IntPtr.Zero, FX.MAKEINTRESOURCE(32512)), + lpszClassName = (ushort*)name + }; + + // Register the window class + _ = FX.RegisterClassExW(&windowClassEx); + + Rectangle windowRect = new(0, 0, (int)width, (int)height); + + // Set the target window size + _ = FX.AdjustWindowRect((RECT*)&windowRect, FX.WS_OVERLAPPEDWINDOW, FX.FALSE); + + height = (uint)(windowRect.Bottom - windowRect.Top); + width = (uint)(windowRect.Right - windowRect.Left); + + // Create the window and store a handle to it + hwnd = FX.CreateWindowExW( + 0, + windowClassEx.lpszClassName, + (ushort*)windowTitle, + FX.WS_OVERLAPPEDWINDOW, + FX.CW_USEDEFAULT, + FX.CW_USEDEFAULT, + (int)width, + (int)height, + HWND.NULL, + HMENU.NULL, + hInstance, + (void*)GCHandle.ToIntPtr(GCHandle.Alloc(application)) + ); + + MARGINS margins = default; + margins.cxLeftWidth = -1; + margins.cxRightWidth = -1; + margins.cyTopHeight = -1; + margins.cyBottomHeight = -1; + + _ = FX.DwmExtendFrameIntoClientArea(hwnd, &margins); + } + + windowSize = new Size((int)height, (int)width); + + // Initialize the application + application.OnInitialize(windowSize, hwnd); + + // Display the window + _ = FX.ShowWindow(hwnd, FX.SW_SHOWDEFAULT); + + // Start the timer + stopwatch = Stopwatch.StartNew(); + + MSG msg = default; + + // Process any messages in the queue + while (msg.message != FX.WM_QUIT) + { + if (FX.PeekMessageW(&msg, HWND.NULL, 0, 0, FX.PM_REMOVE) != 0) + { + _ = FX.TranslateMessage(&msg); + _ = FX.DispatchMessageW(&msg); + } + else if (!isPaused || true) + { + RunApp(); + } + else + { + Thread.Sleep(100); + } + } + + // Return this part of the WM_QUIT message to Windows + return (int)msg.wParam; + } + + /// + /// The application state update method that is invoked within the main application loop. + /// + private static void RunApp() + { + // Update window title approx every second + if (stopwatch.ElapsedMilliseconds - elapsedMillisecondsForLastTitleUpdate >= 1000) + { + string title = isPaused switch + { + true => $"{application.Title} - Paused", + false => $"{application.Title} - FPS: {elapsedFramesSinceLastTitleUpdate}" + }; + + fixed (char* pTitle = title) + { + _ = FX.SetWindowTextW(hwnd, (ushort*)pTitle); + } + + elapsedMillisecondsForLastTitleUpdate = stopwatch.ElapsedMilliseconds; + elapsedFramesSinceLastTitleUpdate = 0; + } + + // Update the application state + application.OnUpdate(stopwatch.Elapsed); + + elapsedFramesSinceLastTitleUpdate++; + } + + /// + /// Processes incoming messages for a window. + /// + /// A handle to the window. + /// The message. + /// Additional message information (the contents depend on the value of ). + /// Additional message information (the contents depend on the value of ). + /// The result of the message processing for the input message. + [UnmanagedCallersOnly] + private static nint WindowProc(IntPtr hwnd, uint uMsg, nuint wParam, nint lParam) + { + switch (uMsg) + { + // Change the paused state on window activation + case FX.WM_ACTIVATE: + { + if (FX.LOWORD(wParam) == FX.WA_INACTIVE) + { + isPaused = true; + } + else + { + isPaused = false; + } + return 0; + } + + // Change the paused state when ESC is pressed + case FX.WM_KEYDOWN: + { + if ((ConsoleKey)wParam == ConsoleKey.Escape) + { + + if (isPaused) + { + FX.SetCapture(hwnd); + } + else + { + FX.ReleaseCapture(); + } + + isPaused = !isPaused; + } + + return 0; + } + + // Window resize started + case FX.WM_ENTERSIZEMOVE: + { + isResizing = true; + + return 0; + } + + // Window resize completed + case FX.WM_EXITSIZEMOVE: + { + isResizing = false; + application.OnResize(windowSize); + + return 0; + } + + // Size update + case FX.WM_SIZE: + { + uint size = (uint)lParam; + + windowSize = new Size(FX.LOWORD(size), FX.HIWORD(size)); + + if (!isResizing && wParam != FX.SIZE_MINIMIZED) + { + application.OnResize(windowSize); + } + + return 0; + } + + // Size and position of the window (needed to enable the borderless mode) + case FX.WM_NCCALCSIZE: + { + return 0; + } + + // Enable dragging the window + case FX.WM_NCHITTEST: + { + POINT point; + RECT rect; + + _ = FX.GetCursorPos(&point); + _ = FX.GetWindowRect(hwnd, &rect); + + bool + isAtTop = Math.Abs(point.y - rect.top) < 12, + isAtRight = Math.Abs(point.x - rect.right) < 12, + isAtBottom = Math.Abs(point.y - rect.bottom) < 12, + isAtLeft = Math.Abs(point.x - rect.left) < 12; + + if (isAtTop) + { + if (isAtRight) return FX.HTTOPRIGHT; + if (isAtLeft) return FX.HTTOPLEFT; + return FX.HTTOP; + } + + if (isAtRight) + { + if (isAtTop) return FX.HTTOPRIGHT; + if (isAtBottom) return FX.HTBOTTOMRIGHT; + return FX.HTRIGHT; + } + + if (isAtBottom) + { + if (isAtRight) return FX.HTBOTTOMRIGHT; + if (isAtLeft) return FX.HTBOTTOMLEFT; + return FX.HTBOTTOM; + } + + if (isAtLeft) + { + if (isAtTop) return FX.HTTOPLEFT; + if (isAtBottom) return FX.HTBOTTOMLEFT; + return FX.HTLEFT; + } + + return FX.HTCAPTION; + } + + // Restore the drop shadow + case FX.WM_DWMCOMPOSITIONCHANGED: + { + MARGINS margins = default; + margins.cxLeftWidth = -1; + margins.cxRightWidth = -1; + margins.cyTopHeight = -1; + margins.cyBottomHeight = -1; + + _ = FX.DwmExtendFrameIntoClientArea(hwnd, &margins); + + return 0; + } + + // Shutdown + case FX.WM_DESTROY: + { + FX.PostQuitMessage(0); + return 0; + } + } + + return FX.DefWindowProcW(hwnd, uMsg, wParam, lParam); + } + } +} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj new file mode 100644 index 00000000..44b2ad45 --- /dev/null +++ b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj @@ -0,0 +1,16 @@ + + + + Exe + net5.0 + + + + + + + + diff --git a/samples/ComputeSharp.SwapChain/Program.cs b/samples/ComputeSharp.SwapChain/Program.cs new file mode 100644 index 00000000..3e0d87df --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Program.cs @@ -0,0 +1,48 @@ +using System; +using ComputeSharp.SwapChain.Backend; +using ComputeSharp.SwapChain.Shaders; + +namespace ComputeSharp.SwapChain +{ + class Program + { + /// + /// The mapping of available samples to choose from. + /// + private static readonly Win32Application[] Samples = new Win32Application[] + { + new SwapChainApplication(static (texture, time) => new(texture, (float)time.TotalSeconds)), + new SwapChainApplication(static (texture, time) => new(texture, (float)time.TotalSeconds)), + new SwapChainApplication(static (texture, time) => new(texture, (float)time.TotalSeconds)), + new SwapChainApplication(static (texture, time) => new(texture, (float)time.TotalSeconds)), + new SwapChainApplication(static (texture, time) => new(texture, (float)time.TotalSeconds)), + new SwapChainApplication(static (texture, time) => new(texture, (float)time.TotalSeconds)) + }; + + static void Main() + { + Console.WriteLine("Available samples:"); + Console.WriteLine(); + + for (int i = 0; i < Samples.Length; i++) + { + Console.WriteLine($"{i}: {Samples[i].GetType().GenericTypeArguments[0].Name}"); + } + + Console.WriteLine(); + + int index; + + do + { + Console.Write("Enter the index of the sample to run: "); + } + while (!int.TryParse(Console.ReadLine(), out index)); + + Console.WriteLine(); + Console.WriteLine($"Starting {Samples[index].GetType().GenericTypeArguments[0].Name}..."); + + Win32ApplicationRunner.Run(Samples[index]); + } + } +} diff --git a/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs b/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs new file mode 100644 index 00000000..7ab620e1 --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs @@ -0,0 +1,79 @@ +namespace ComputeSharp.SwapChain.Shaders +{ + /// + /// A shader creating an abstract and colorful animation. + /// Ported from . + /// Created by Benoit Marini. + /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// + [AutoConstructor] + internal readonly partial struct ColorfulInfinity : IComputeShader + { + /// + /// The target texture. + /// + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + /// + /// The total number of layers for the final animation. + /// + private const float NumberOfLayers = 16.0f; + + /// + /// The number of iterations to calculate a texel value. + /// + private const int NumberOfIterations = 23; + + /// + /// Makes some magic happen. + /// + private Float4 Tex(Float3 p) + { + float t = time + 78.0f; + Float4 o = new(p.X, p.Y, p.Z, 3.0f * Hlsl.Sin(t * 0.1f)); + Float4 dec = + new Float4(1.0f, 0.9f, 0.1f, 0.15f) + + new Float4(0.06f * Hlsl.Cos(t * 0.1f), 0, 0, 0.14f * Hlsl.Cos(t * 0.23f)); + + for (int i = 0; i++ < NumberOfIterations;) + { + o.XZYW = Hlsl.Abs(o / Hlsl.Dot(o, o) - dec); + } + + return o; + } + + /// + public void Execute() + { + int width = texture.Width; + int height = texture.Height; + + Float2 uv = ((Float2)ThreadIds.XY - (Float2)(new Int2(width, height)) * 0.5f) / height; + Float3 col = 0; + float t = time * 0.3f; + + for (float i = 0.0f; i <= 1.0f; i += 1.0f / NumberOfLayers) + { + float d = Hlsl.Frac(i + t); + float s = Hlsl.Lerp(5.0f, 0.5f, d); + float f = d * Hlsl.SmoothStep(1.0f, 0.9f, d); + + col += Tex(new Float3(uv.X * s, uv.Y * s, i * 4.0f)).XYZ * f; + } + + col /= NumberOfLayers; + col *= new Float3(2, 1.0f, 2.0f); + col = Hlsl.Pow(col, 0.5f); + + Float4 color = new(col.X, col.Y, col.Z, 1.0f); + + texture[ThreadIds.XY] = color; + } + } +} diff --git a/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs b/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs new file mode 100644 index 00000000..db12f72d --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs @@ -0,0 +1,51 @@ +namespace ComputeSharp.SwapChain.Shaders +{ + /// + /// A shader creating a fractal tiling animation. + /// Ported from . + /// Created by Inigo Quilez. + /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// + [AutoConstructor] + internal readonly partial struct FractalTiling : IComputeShader + { + /// + /// The target texture. + /// + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + /// + public void Execute() + { + Float2 position = ((Float2)(256 * ThreadIds.XY)) / texture.Width + time; + Float4 color = 0; + + for (int i = 0; i < 6; i++) + { + Float2 a = Hlsl.Floor(position); + Float2 b = Hlsl.Frac(position); + Float4 w = Hlsl.Frac( + (Hlsl.Sin(a.X * 7 + 31.0f * a.Y + 0.01f * time) + + new Float4(0.035f, 0.01f, 0, 0.7f)) + * 13.545317f); + + color.XYZ += w.XYZ * + 2.0f * Hlsl.SmoothStep(0.45f, 0.55f, w.W) * + Hlsl.Sqrt(16.0f * b.X * b.Y * (1.0f - b.X) * (1.0f - b.Y)); + + position /= 2.0f; + color /= 2.0f; + } + + color.XYZ = Hlsl.Pow(color.XYZ, new Float3(0.7f, 0.8f, 0.5f)); + color.W = 1.0f; + + texture[ThreadIds.XY] = color; + } + } +} diff --git a/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs b/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs new file mode 100644 index 00000000..024ef622 --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs @@ -0,0 +1,171 @@ +namespace ComputeSharp.SwapChain.Shaders +{ + /// + /// A shader creating a flythrough in a Menger system. + /// Ported from . + /// Created by Syntopia. + /// + [AutoConstructor] + internal readonly partial struct MengerJourney : IComputeShader + { + /// + /// The target texture. + /// + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + private const int MaxSteps = 30; + private const float MinimumDistance = 0.0009f; + private const float normalDistance = 0.0002f; + private const int Iterations = 7; + private const float Scale = 3.0f; + private const float FieldOfView = 1.0f; + private const float Jitter = 0.05f; + private const float FudgeFactor = 0.7f; + private const float NonLinearPerspective = 2.0f; + private const float Ambient = 0.32184f; + private const float Diffuse = 0.5f; + + /// + /// Rotates a given value by a specified amount. + /// + private static Float2 Rotate(Float2 v, float a) + { + return new(Hlsl.Cos(a) * v.X + Hlsl.Sin(a) * v.Y, -Hlsl.Sin(a) * v.X + Hlsl.Cos(a) * v.Y); + } + + /// + /// Calculates the light at a specified normal and starting color. + /// Uses two light sources and no specular lights. + /// + private static Float3 GetLight(in Float3 color, in Float3 normal) + { + Float3 lightDir = Hlsl.Normalize((Float3)1); + float diffuse = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir)); + + Float3 lightDir2 = Hlsl.Normalize(new Float3(1.0f, -1.0f, 1.0f)); + float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2)); + + return + (diffuse * Diffuse) * (new Float3(1.0f, 1.0f, 0.858824f) * color) + + (diffuse2 * Diffuse) * (new Float3(0.0f, 0.333333f, 1.0f) * color); + } + + /// + /// DE: Infinitely tiled Menger IFS. + /// For more info on KIFS, see + /// + private float DE(Float3 z) + { + // Performs the GLSL mod function. + static Float3 Mod(Float3 x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + z = Hlsl.Abs(1.0f - Mod(z, 2.0f)); + + float d = 1000.0f; + Float3 Offset = new(0.92858f, 0.92858f, 0.32858f); + + for (int n = 0; n < Iterations; n++) + { + z.XY = Rotate(z.XY, 4.0f + 2.0f * Hlsl.Cos(time / 8.0f)); + z = Hlsl.Abs(z); + + if (z.X < z.Y) { z.XY = z.YX; } + if (z.X < z.Z) { z.XZ = z.ZX; } + if (z.Y < z.Z) { z.YZ = z.ZY; } + + z = Scale * z - Offset * (Scale - 1.0f); + + if (z.Z < -0.5f * Offset.Z * (Scale - 1.0)) + { + z.Z += Offset.Z * (Scale - 1.0f); + } + + d = Hlsl.Min(d, Hlsl.Length(z) * Hlsl.Pow(Scale, -n - 1.0f)); + } + + return d - 0.001f; + } + + /// + /// Calculates the finite difference normal at a given position. + /// + private Float3 getNormal(in Float3 pos) + { + Float3 e = new(0.0f, normalDistance, 0.0f); + + return Hlsl.Normalize(new Float3( + DE(pos + e.YXX) - DE(pos - e.YXX), + DE(pos + e.XYX) - DE(pos - e.XYX), + DE(pos + e.XXY) - DE(pos - e.XXY))); + } + + /// + /// Performs a ray march operation on a specific position. + /// + private Float4 RayMarch(in Float3 from, Float3 dir, in Float2 fragCoord) + { + // Computes a pseudo-random number + static float Rand(Float2 co) + { + return Hlsl.Frac(Hlsl.Cos(Hlsl.Dot(co, new Float2(4.898f, 7.23f))) * 23421.631f); + } + + float totalDistance = Jitter * Rand(fragCoord.XY + time); + Float3 dir2 = dir; + float distance = 0; + int steps = 0; + Float3 pos = 0; + + for (int i = 0; i < MaxSteps; i++) + { + dir.ZY = Rotate(dir2.ZY, totalDistance * Hlsl.Cos(time / 4.0f) * NonLinearPerspective); + pos = from + totalDistance * dir; + distance = DE(pos) * FudgeFactor; + totalDistance += distance; + + if (distance < MinimumDistance) break; + + steps = i; + } + + float smoothStep = steps + distance / MinimumDistance; + float ao = 1.1f - smoothStep / MaxSteps; + Float3 normal = getNormal(pos - dir * normalDistance * 3.0f); + Float3 color = 1.0f; + Float3 light = GetLight(color, normal); + + color = (color * Ambient + light) * ao; + + return new(color.X, color.Y, color.Z, 1.0f); + } + + /// + public void Execute() + { + Float3 camPos = 0.5f * time * new Float3(1.0f, 0.0f, 0.0f); + Float3 target = camPos + new Float3(1.0f, 0.0f * Hlsl.Cos(time), 0.0f * Hlsl.Sin(0.4f * time)); + Float3 camDir = Hlsl.Normalize(target - camPos); + Float3 camUp = new Float3(0.0f, 1.0f, 0.0f); + + camUp = Hlsl.Normalize(camUp - Hlsl.Dot(camDir, camUp) * camDir); + + Float3 camRight = Hlsl.Normalize(Hlsl.Cross(camDir, camUp)); + Float2 resolution = new(texture.Width, texture.Height); + Float2 coord = -1.0f + 2.0f * (Float2)ThreadIds.XY / resolution; + + coord.X *= resolution.X / resolution.Y; + + Float3 rayDir = Hlsl.Normalize(camDir + (coord.X * camRight + coord.Y * camUp) * FieldOfView); + + texture[ThreadIds.XY] = RayMarch(camPos, rayDir, ThreadIds.XY); + } + } +} diff --git a/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs b/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs new file mode 100644 index 00000000..dfd79d8b --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs @@ -0,0 +1,129 @@ +namespace ComputeSharp.SwapChain.Shaders +{ + /// + /// A shader creating an octagram animation, inspired by arabesque. + /// Ported from . + /// Created by whisky_shusuky. + /// + [AutoConstructor] + internal readonly partial struct Octagrams : IComputeShader + { + /// + /// The target texture. + /// + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + private static Float2x2 Rotate(float a) + { + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); + + return new(c, s, -s, c); + } + + private static float Box(Float3 pos, float scale) + { + static float SDBox(Float3 p, Float3 b) + { + Float3 q = Hlsl.Abs(p) - b; + + return Hlsl.Length(Hlsl.Max(q, 0.0f)) + + Hlsl.Min(Hlsl.Max(q.X, Hlsl.Max(q.Y, q.Z)), 0.0f); + } + + pos *= scale; + + float b = SDBox(pos, new(0.4f, 0.4f, 0.1f)) / 1.5f; + + pos.XY *= 5.0f; + pos.Y -= 3.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.75f)); + + return -b; + } + + private static float BoxSet(Float3 pos, float gTime) + { + Float3 pos_origin = pos; + + pos = pos_origin; + pos.Y += Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box1 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.Y -= Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box2 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.X += Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box3 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.X -= Hlsl.Sin(gTime * 0.4f) * 2.5f; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box4 = Box(pos, 2.0f - Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f); + + pos = pos_origin; + pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); + + float box5 = Box(pos, 0.5f) * 6.0f; + + pos = pos_origin; + + float box6 = Box(pos, 0.5f) * 6.0f; + float result = Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(box1, box2), box3), box4), box5), box6); + + return result; + } + + /// + public void Execute() + { + Int2 resolution = new(texture.Width, texture.Height); + Float2 p = ((Float2)ThreadIds.XY * 2.0f - resolution) / Hlsl.Min(resolution.X, resolution.Y); + Float3 ro = new(0.0f, -0.2f, time * 4.0f); + Float3 ray = Hlsl.Normalize(new Float3(p, 1.5f)); + + ray.XY = Hlsl.Mul(ray.XY, Rotate(Hlsl.Sin(time * 0.03f) * 5.0f)); + ray.YZ = Hlsl.Mul(ray.YZ, Rotate(Hlsl.Sin(time * 0.05f) * 0.2f)); + + float t = 0.1f; + float ac = 0.0f; + + for (int i = 0; i < 99; i++) + { + static Float3 Mod(Float3 x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + Float3 pos = ro + ray * t; + + pos = Mod(pos - 2.0f, 4.0f) - 2.0f; + + float gTime = time - i * 0.01f; + float d = BoxSet(pos, gTime); + + d = Hlsl.Max(Hlsl.Abs(d), 0.01f); + ac += Hlsl.Exp(-d * 23.0f); + t += d * 0.55f; + } + + Float3 col = ac * 0.02f + new Float3(0.0f, 0.2f * Hlsl.Abs(Hlsl.Sin(time)), 0.5f + Hlsl.Sin(time) * 0.2f); + Float4 color = new(col, 1.0f - t * (0.02f + 0.02f * Hlsl.Sin(time))); + + texture[ThreadIds.XY] = color; + } + } +} diff --git a/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs b/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs new file mode 100644 index 00000000..1a197dce --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs @@ -0,0 +1,174 @@ +namespace ComputeSharp.SwapChain.Shaders +{ + /// + /// Fully procedural 3D animated volume with three evaluations per step (for shading). + /// Ported from . + /// Created by nimitz (twitter: @stormoid). + /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. + /// + [AutoConstructor] + internal readonly partial struct ProteanClouds : IComputeShader + { + /// + /// The target texture. + /// + public readonly IReadWriteTexture2D texture; + + /// + /// The current time Hlsl.Since the start of the application. + /// + public readonly float time; + + private static Float2x2 Rotate(in float a) + { + float c = Hlsl.Cos(a), s = Hlsl.Sin(a); + + return new(c, s, -s, c); + } + + private static float LinStep(in float mn, in float mx, in float x) + { + return Hlsl.Clamp((x - mn) / (mx - mn), 0.0f, 1.0f); + } + + private static Float2 Disp(float t) + { + return new Float2(Hlsl.Sin(t * 0.22f) * 1.0f, Hlsl.Cos(t * 0.175f) * 1.0f) * 2.0f; + } + + private Float2 Map(Float3 p, float prm1, Float2 bsMo) + { + Float3 p2 = p; + + p2.XY -= Disp(p.Z).XY; + p.XY = Hlsl.Mul(p.XY, Rotate(Hlsl.Sin(p.Z + time) * (0.1f + prm1 * 0.05f) + time * 0.09f)); + + float cl = Hlsl.Dot(p2.XY, p2.XY); + float d = 0.0f; + + p *= 0.61f; + + float z = 1.0f; + float trk = 1.0f; + float dspAmp = 0.1f + prm1 * 0.2f; + + for (int i = 0; i < 5; i++) + { + p += Hlsl.Sin(p.ZXY * 0.75f * trk + time * trk * 0.8f) * dspAmp; + d -= Hlsl.Abs(Hlsl.Dot(Hlsl.Cos(p), Hlsl.Sin(p.YZX)) * z); + z *= 0.57f; + trk *= 1.4f; + + Float3x3 m3 = new Float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f; + + p = Hlsl.Mul(p, m3); + } + + d = Hlsl.Abs(d + prm1 * 3.0f) + prm1 * 0.3f - 2.5f + bsMo.Y; + + return new Float2(d + cl * 0.2f + 0.25f, cl); + } + + private Float4 Render(Float3 ro, Float3 rd, float time, float prm1, Float2 bsMo) + { + Float4 rez = 0; + float t = 1.5f; + float fogT = 0; + + for (int i = 0; i < 130; i++) + { + if (rez.A > 0.99f) break; + + Float3 pos = ro + t * rd; + Float2 mpv = Map(pos, prm1, bsMo); + float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f; + float dn = Hlsl.Clamp((mpv.X + 2.0f), 0.0f, 3.0f); + Float4 col = 0f; + + if (mpv.X > 0.6f) + { + + col = new Float4(Hlsl.Sin(new Float3(5.0f, 0.4f, 0.2f) + mpv.Y * 0.1f + Hlsl.Sin(pos.Z * 0.4f) * 0.5f + 1.8f) * 0.5f + 0.5f, 0.08f); + col *= den * den * den; + col.RGB *= LinStep(4.0f, -2.5f, mpv.X) * 2.3f; + + float dif = Hlsl.Clamp((den - Map(pos + 0.8f, prm1, bsMo).X) / 9.0f, 0.001f, 1.0f); + + dif += Hlsl.Clamp((den - Map(pos + 0.35f, prm1, bsMo).X) / 2.5f, 0.001f, 1.0f); + col.XYZ *= den * (new Float3(0.005f, 0.045f, 0.075f) + 1.5f * new Float3(0.033f, 0.07f, 0.03f) * dif); + } + + float fogC = Hlsl.Exp(t * 0.2f - 2.2f); + + col += new Float4(0.06f, 0.11f, 0.11f, 0.1f) * Hlsl.Clamp(fogC - fogT, 0.0f, 1.0f); + fogT = fogC; + rez += col * (1.0f - rez.A); + t += Hlsl.Clamp(0.5f - dn * dn * 0.05f, 0.09f, 0.3f); + } + + return Hlsl.Clamp(rez, 0.0f, 1.0f); + } + + private static float GetSaturation(Float3 c) + { + float mi = Hlsl.Min(Hlsl.Min(c.X, c.Y), c.Z); + float ma = Hlsl.Max(Hlsl.Max(c.X, c.Y), c.Z); + + return (ma - mi) / (ma + (float)1e-7); + } + + private static Float3 ILerp(in Float3 a, in Float3 b, in float x) + { + Float3 ic = Hlsl.Lerp(a, b, x) + new Float3((float)1e-6, 0.0f, 0.0f); + float sd = Hlsl.Abs(GetSaturation(ic) - Hlsl.Lerp(GetSaturation(a), GetSaturation(b), x)); + Float3 dir = Hlsl.Normalize(new Float3(2.0f * ic.X - ic.Y - ic.Z, 2.0f * ic.Y - ic.X - ic.Z, 2.0f * ic.Z - ic.Y - ic.X)); + float lgt = Hlsl.Dot(1.0f, ic); + float ff = Hlsl.Dot(dir, Hlsl.Normalize(ic)); + + ic += 1.5f * dir * sd * ff * lgt; + + return Hlsl.Clamp(ic, 0.0f, 1.0f); + } + + /// + public void Execute() + { + Int2 resolution = new(texture.Width, texture.Height); + Float2 q = (Float2)ThreadIds.XY / resolution; + Float2 p = (ThreadIds.XY - 0.5f * (Float2)resolution) / resolution.Y; + Float2 bsMo = -0.5f * (Float2)resolution / resolution.Y; + float scaledTime = time * 3.0f; + Float3 ro = new(0, 0, scaledTime); + + ro += new Float3(Hlsl.Sin(time) * 0.5f, Hlsl.Sin(time * 1.0f) * 0.0f, 0); + + float dspAmp = 0.85f; + + ro.XY += Disp(ro.Z) * dspAmp; + + float tgtDst = 3.5f; + Float3 target = Hlsl.Normalize(ro - new Float3(Disp(scaledTime + tgtDst) * dspAmp, scaledTime + tgtDst)); + + ro.X -= bsMo.X * 2.0f; + + Float3 rightdir = Hlsl.Normalize(Hlsl.Cross(target, new Float3(0, 1, 0))); + Float3 updir = Hlsl.Normalize(Hlsl.Cross(rightdir, target)); + + rightdir = Hlsl.Normalize(Hlsl.Cross(updir, target)); + + Float3 rd = Hlsl.Normalize((p.X * rightdir + p.Y * updir) * 1.0f - target); + + rd.XY = Hlsl.Mul(rd.XY, Rotate(-Disp(scaledTime + 3.5f).X * 0.2f + bsMo.X)); + + float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f)); + Float4 scn = Render(ro, rd, scaledTime, prm1, bsMo); + Float3 col = scn.RGB; + + col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f)); + col = Hlsl.Pow(col, new Float3(0.55f, 0.65f, 0.6f)) * new Float3(1.0f, 0.97f, 0.9f); + col *= Hlsl.Pow(16.0f * q.X * q.Y * (1.0f - q.X) * (1.0f - q.Y), 0.12f) * 0.7f + 0.3f; + + texture[ThreadIds.XY] = new Float4(col, 1.0f); + } + } +} diff --git a/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs b/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs new file mode 100644 index 00000000..f56709a8 --- /dev/null +++ b/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs @@ -0,0 +1,152 @@ +namespace ComputeSharp.SwapChain.Shaders +{ + /// + /// A shader creating an animated two-tiles Truchet arrangement. + /// Ported from . + /// Created by Shane. + /// + [AutoConstructor] + internal readonly partial struct TwoTiledTruchet : IComputeShader + { + /// + /// The target texture. + /// + public readonly IReadWriteTexture2D texture; + + /// + /// The current time since the start of the application. + /// + public readonly float time; + + /// + /// Calculates the Truchet distance field. + /// + /// The input value to compute the distance field for. + /// The resulting Truchet angle. + /// The distance field for the input value. + private Float2 DistanceField(Float2 p, out Float2 ang) + { + // Fast hash for a pair of floats + static float Hash21(Float2 p) + { + return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new Float2(27.619f, 57.583f))) * 43758.5453f); + } + + // HLSL's port of the GLSL mod intrinsic + static float Mod(float x, float y) + { + return x - y * Hlsl.Floor(x / y); + } + + Float2 ip2 = Hlsl.Floor(p / 2.0f); + Float2 ip = Hlsl.Floor(p); + float rnd = Hash21(ip); + float rnd3 = Hash21(ip + 0.57f); + Float2 d = 1e5f; + + p -= ip + 0.5f; + + if (Mod(ip2.X + ip2.Y, 2.0f) < 0.5f) + { + d = Hlsl.Abs(p); + ang = p.YX; + + if (Mod(ip.X + 1.0f, 2.0f) < 0.5f) + { + ang.X *= -1.0f; + + } + + if (Mod(ip.Y + 1.0f, 2.0f) > 0.5f) + { + ang.Y *= -1.0f; + } + + if (rnd3 < .5) + { + d = d.YX; + ang = ang.YX; + } + + ang += 0.5f; + ang *= 3.0f; + + } + else + { + if (rnd < .5) + { + p = p.YX * new Float2(1, -1); + } + + d.X = Hlsl.Length(p - 0.5f) - 0.5f; + d.Y = Hlsl.Length(p + 0.5f) - 0.5f; + + d = Hlsl.Abs(d); + + ang = 0; + ang.X = -Hlsl.Atan((p.Y - 0.5f) / (p.X - 0.5f)); + ang.Y = -Hlsl.Atan((p.Y + 0.5f) / (p.X + 0.5f)); + + if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) + { + ang *= -1.0f; + } + + if (rnd < 0.5f) + { + ang *= -1.0f; + } + + if (rnd3 < 0.5f) + { + d = d.YX; + ang = ang.YX; + } + + ang *= 4.0f / 6.2831853f; + ang *= 2.0f; + } + + ang = Hlsl.Frac(ang + time / 4.0f); + + return d; + } + + /// + public void Execute() + { + int width = texture.Width; + int height = texture.Height; + + Float2 uv = ((Float2)ThreadIds.XY - (Float2)(new Int2(width, height)) * 0.5f) / height; + float gSc = 7.0f; + Float2 p = uv * gSc - new Float2(-1, -0.5f) * time / 2.0f; + float sf = 2.0f / height * gSc; + float lSc = 6.0f; + float lw = 1.0f / lSc / gSc; + Float2 d = DistanceField(p, out Float2 ang) - 2.5f / lSc; + Float3 col = new Float3(1.0f, 0.9f, 0.8f); + + for (int i = 0; i < 2; i++) + { + float di = d[i] - lw / 4.0f; + float tracks = Hlsl.Clamp(Hlsl.Sin(ang[i] * 6.2831f + time * 6.0f) * 4.0f, 0.0f, 1.0f); + float gap = 1.0f + lw; + + col = Hlsl.Lerp(col, 0, (1.0f - Hlsl.SmoothStep(0.0f, sf * 6.0f, di)) * 0.35f); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di)); + col = Hlsl.Lerp(col, new(1.0f, 0.9f, 0.8f), 1.0f - Hlsl.SmoothStep(0.0f, sf, di + lw * 2.0f)); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc)); + col = Hlsl.Lerp(col, 1, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + gap / lSc + lw)); + col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc)); + col = Hlsl.Lerp(col, 1 * tracks, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + 2.0f * gap / lSc + lw)); + } + + Float3 rgb = Hlsl.Sqrt(Hlsl.Max(col, 0.0f)); + Float4 color = new(rgb.X, rgb.Y, rgb.Z, 1.0f); + + texture[ThreadIds.XY] = color; + } + } +} diff --git a/src/ComputeSharp.Core/Attributes/PreserveMemberNameAttribute.cs b/src/ComputeSharp.Core/Attributes/PreserveMemberNameAttribute.cs deleted file mode 100644 index 6140a4d2..00000000 --- a/src/ComputeSharp.Core/Attributes/PreserveMemberNameAttribute.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace ComputeSharp.Core.Attributes -{ - /// - /// An attribute to indicate that a given member has the same name when mapped to HLSL - /// - internal sealed class PreserveMemberNameAttribute : Attribute - { - } -} diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj deleted file mode 100644 index f45bdfcc..00000000 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard2.1 - - - diff --git a/src/ComputeSharp.Core/Extensions/VectorExtensions.cs b/src/ComputeSharp.Core/Extensions/VectorExtensions.cs deleted file mode 100644 index 1c4532ed..00000000 --- a/src/ComputeSharp.Core/Extensions/VectorExtensions.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Numerics; -using System.Runtime.InteropServices; - -namespace ComputeSharp -{ - /// - /// A that contains extension methods for the , and types - /// - public static class VectorExtensions - { - /// - /// Converts a array into a with items of type - /// - /// The input array - /// A with items of type , mapping the original array - [Pure] - public static Span AsFloat2Span(this Vector2[] array) => MemoryMarshal.Cast(array); - - /// - /// Converts a into a with items of type - /// - /// The input - /// A with items of type , mapping the original - [Pure] - public static Span AsFloat2Span(this Span span) => MemoryMarshal.Cast(span); - - /// - /// Converts a array into a with items of type - /// - /// The input array - /// A with items of type , mapping the original array - [Pure] - public static Span AsFloat3Span(this Vector3[] array) => MemoryMarshal.Cast(array); - - /// - /// Converts a into a with items of type - /// - /// The input - /// A with items of type , mapping the original - [Pure] - public static Span AsFloat3Span(this Span span) => MemoryMarshal.Cast(span); - - /// - /// Converts a array into a with items of type - /// - /// The input array - /// A with items of type , mapping the original array - [Pure] - public static Span AsFloat4Span(this Vector4[] array) => MemoryMarshal.Cast(array); - - /// - /// Converts a into a with items of type - /// - /// The input - /// A with items of type , mapping the original - [Pure] - public static Span AsFloat4Span(this Span span) => MemoryMarshal.Cast(span); - } -} diff --git a/src/ComputeSharp.Core/Intrinsics/Hlsl.cs b/src/ComputeSharp.Core/Intrinsics/Hlsl.cs deleted file mode 100644 index e4740576..00000000 --- a/src/ComputeSharp.Core/Intrinsics/Hlsl.cs +++ /dev/null @@ -1,3390 +0,0 @@ -using System.Diagnostics.Contracts; -using System.Numerics; -using ComputeSharp.Core.Attributes; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the supported HLSL intrinsic functions that can be used in compute shaders - /// - public static class Hlsl - { - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static int Abs(int x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}(int)"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Int2 Abs(Int2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Int2)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Int3 Abs(Int3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Int3)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Int4 Abs(Int4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Int4)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static float Abs(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}(float)"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Float2 Abs(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Float2)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Float3 Abs(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Float3)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Float4 Abs(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Float4)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Vector2 Abs(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector2)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Vector3 Abs(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector3)})"); - - /// - /// Returns the absolute value of the specified value - /// - /// The specified value - /// The absolute value of the parameter - [Pure] - public static Vector4 Abs(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Abs)}({nameof(Vector4)})"); - - /// - /// Returns the arccosine of the specified value - /// - /// The specified value, which should be within the range [-1 to 1] - /// The arccosine of the parameter - [Pure] - public static float Acos(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}(float)"); - - /// - /// Returns the arccosine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arccosine of the parameter - [Pure] - public static Float2 Acos(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Float2)})"); - - /// - /// Returns the arccosine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arccosine of the parameter - [Pure] - public static Float3 Acos(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Float3)})"); - - /// - /// Returns the arccosine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arccosine of the parameter - [Pure] - public static Float3 Acos(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Float4)})"); - - /// - /// Returns the arccosine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arccosine of the parameter - [Pure] - public static Vector2 Acos(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector2)})"); - - /// - /// Returns the arccosine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arccosine of the parameter - [Pure] - public static Vector3 Acos(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector3)})"); - - /// - /// Returns the arccosine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arccosine of the parameter - [Pure] - public static Vector3 Acos(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Acos)}({nameof(Vector4)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Int2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Int2)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Int3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Int3)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Int4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Int4)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Float2)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Float3)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Float4)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector2)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector3)})"); - - /// - /// Determines if all components of the specified value are non-zero - /// - /// The specified value - /// if all components of the parameter are non-zero; otherwise, - [Pure] - public static bool All(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(All)}({nameof(Vector4)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Int2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Int2)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Int3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Int3)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Int4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Int4)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Float2)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Float3)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Float4)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector2)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector3)})"); - - /// - /// Determines if any components of the specified value are non-zero - /// - /// The specified value - /// if any components of the parameter are non-zero; otherwise, - [Pure] - public static bool Any(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Any)}({nameof(Vector4)})"); - - /// - /// Reinterprets a cast value (two 32-bit values) into a - /// - /// The low 32-bit pattern of the input value - /// The high 32-bit pattern of the input value - /// The input (two 32-bit values) recast as a - [Pure] - public static double AsDouble(uint lowBits, uint highBits) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsDouble)}(uint,uint)"); - - /// - /// Reinterprets a cast value (two 32-bit values) into a - /// - /// The low 32-bit pattern of the input value - /// The high 32-bit pattern of the input value - /// The input (two 32-bit values) recast as a - [Pure] - public static Double2 AsDouble(UInt2 lowBits, UInt2 highBits) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsDouble)}({nameof(UInt2)},{nameof(UInt2)})"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static float AsFloat(int x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}(int)"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static Float2 AsFloat(Int2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}({nameof(Int2)})"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static Float3 AsFloat(Int3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}({nameof(Int3)})"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static Float4 AsFloat(Int4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}({nameof(Int4)})"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static float AsFloat(uint x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}(uint)"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static Float2 AsFloat(UInt2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}({nameof(UInt2)})"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static Float3 AsFloat(UInt3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}({nameof(UInt3)})"); - - /// - /// Interprets the bit pattern of as a floating-point number - /// - /// The input value - /// The input interpreted as a floating-point number - [Pure] - public static Float4 AsFloat(UInt4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(AsFloat)}({nameof(UInt4)})"); - - /// - /// Returns the arcsine of the specified value - /// - /// The specified value, which should be within the range [-1 to 1] - /// The arcsine of the parameter - [Pure] - public static float Asin(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}(float)"); - - /// - /// Returns the arcsine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arcsine of the parameter - [Pure] - public static Float2 Asin(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Float2)})"); - - /// - /// Returns the arcsine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arcsine of the parameter - [Pure] - public static Float3 Asin(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Float3)})"); - - /// - /// Returns the arcsine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arcsine of the parameter - [Pure] - public static Float3 Asin(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Float4)})"); - - /// - /// Returns the arcsine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arcsine of the parameter - [Pure] - public static Vector2 Asin(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector2)})"); - - /// - /// Returns the arcsine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arcsine of the parameter - [Pure] - public static Vector3 Asin(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector3)})"); - - /// - /// Returns the arcsine of the specified value - /// - /// The specified value, where each component should be within the range [-1 to 1] - /// The arcsine of the parameter - [Pure] - public static Vector3 Asin(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Asin)}({nameof(Vector4)})"); - - /// - /// Returns the arctangent of the specified value - /// - /// The specified value - /// The arctangent of the parameter - [Pure] - public static float Atan(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}(float)"); - - /// - /// Returns the arctangent of the specified value - /// - /// The specified value - /// The arctangent of the parameter - [Pure] - public static Float2 Atan(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Float2)})"); - - /// - /// Returns the arctangent of the specified value - /// - /// The specified value - /// The arctangent of the parameter - [Pure] - public static Float3 Atan(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Float3)})"); - - /// - /// Returns the arctangent of the specified value - /// - /// The specified value - /// The arctangent of the parameter - [Pure] - public static Float3 Atan(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Float4)})"); - - /// - /// Returns the arctangent of the specified value - /// - /// The specified value - /// The arctangent of the parameter - [Pure] - public static Vector2 Atan(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector2)})"); - - /// - /// Returns the arctangent of the specified value - /// - /// The specified value - /// The arctangent of the parameter - [Pure] - public static Vector3 Atan(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector3)})"); - - /// - /// Returns the arctangent of the specified value - /// - /// The specified value - /// The arctangent of the parameter - [Pure] - public static Vector3 Atan(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan)}({nameof(Vector4)})"); - - /// - /// Returns the arctangent of two values (,) - /// - /// The value - /// The value - /// The arctangent of (,) - [Pure] - public static float Atan2(float y, float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}(float,float)"); - - /// - /// Returns the arctangent of two values (,) - /// - /// The value - /// The value - /// The arctangent of (,) - [Pure] - public static Float2 Atan2(Float2 y, Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns the arctangent of two values (,) - /// - /// The value - /// The value - /// The arctangent of (,) - [Pure] - public static Float3 Atan2(Float3 y, Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns the arctangent of two values (,) - /// - /// The value - /// The value - /// The arctangent of (,) - [Pure] - public static Float3 Atan2(Float4 y, Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns the arctangent of two values (,) - /// - /// The value - /// The value - /// The arctangent of (,) - [Pure] - public static Vector2 Atan2(Vector2 y, Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns the arctangent of two values (,) - /// - /// The value - /// The value - /// The arctangent of (,) - [Pure] - public static Vector3 Atan2(Vector3 y, Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns the arctangent of two values (,) - /// - /// The value - /// The value - /// The arctangent of (,) - [Pure] - public static Vector3 Atan2(Vector4 y, Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Atan2)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value - /// - /// The specified value - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter - [Pure] - public static float Ceil(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}(float)"); - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value - /// - /// The specified value - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter - [Pure] - public static Float2 Ceil(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Float2)})"); - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value - /// - /// The specified value - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter - [Pure] - public static Float3 Ceil(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Float3)})"); - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value - /// - /// The specified value - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter - [Pure] - public static Float3 Ceil(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Float4)})"); - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value - /// - /// The specified value - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter - [Pure] - public static Vector2 Ceil(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector2)})"); - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value - /// - /// The specified value - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter - [Pure] - public static Vector3 Ceil(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector3)})"); - - /// - /// Returns the smallest integer value that is greater than or equal to the specified value - /// - /// The specified value - /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter - [Pure] - public static Vector3 Ceil(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ceil)}({nameof(Vector4)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static int Clamp(int x, int min, int max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}(int,int,int)"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Int2 Clamp(Int2 x, Int2 min, Int2 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Int2)},{nameof(Int2)},{nameof(Int2)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Int3 Clamp(Int3 x, Int3 min, Int3 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Int3)},{nameof(Int3)},{nameof(Int3)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Int4 Clamp(Int4 x, Int4 min, Int4 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Int4)},{nameof(Int4)},{nameof(Int4)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static float Clamp(float x, float min, float max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}(float,float,float)"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Float2 Clamp(Float2 x, Float2 min, Float2 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Float2)},{nameof(Float2)},{nameof(Float2)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Float3 Clamp(Float3 x, Float3 min, Float3 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Float3)},{nameof(Float3)},{nameof(Float3)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Float4 Clamp(Float4 x, Float4 min, Float4 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Float4)},{nameof(Float4)},{nameof(Float4)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Vector2 Clamp(Vector2 x, Vector2 min, Vector2 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Vector3 Clamp(Vector3 x, Vector3 min, Vector3 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Clamps the specified value to the specified minimum and maximum range - /// - /// A value to clamp - /// The specified minimum range - /// The specified maximum range - /// The clamped value for the x parameter - /// For values of -INF or INF, clamp will behave as expected. However for values of NaN, the results are undefined - [Pure] - public static Vector4 Clamp(Vector4 x, Vector4 min, Vector4 max) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Clamp)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the cosine of the specified value - /// - /// The specified value, radians - /// The cosine of the parameter - [Pure] - public static float Cos(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}(float)"); - - /// - /// Returns the cosine of the specified value - /// - /// The specified value, radians - /// The cosine of the parameter - [Pure] - public static Float2 Cos(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Float2)})"); - - /// - /// Returns the cosine of the specified value - /// - /// The specified value, radians - /// The cosine of the parameter - [Pure] - public static Float3 Cos(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Float3)})"); - - /// - /// Returns the cosine of the specified value - /// - /// The specified value, radians - /// The cosine of the parameter - [Pure] - public static Float3 Cos(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Float4)})"); - - /// - /// Returns the cosine of the specified value - /// - /// The specified value, radians - /// The cosine of the parameter - [Pure] - public static Vector2 Cos(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector2)})"); - - /// - /// Returns the cosine of the specified value - /// - /// The specified value, radians - /// The cosine of the parameter - [Pure] - public static Vector3 Cos(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector3)})"); - - /// - /// Returns the cosine of the specified value - /// - /// The specified value, radians - /// The cosine of the parameter - [Pure] - public static Vector3 Cos(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cos)}({nameof(Vector4)})"); - - /// - /// Returns the hyperbolic cosine of the specified value - /// - /// The specified value, radians - /// The hyperbolic cosine of the parameter - [Pure] - public static float Cosh(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}(float)"); - - /// - /// Returns the hyperbolic cosine of the specified value - /// - /// The specified value, radians - /// The hyperbolic cosine of the parameter - [Pure] - public static Float2 Cosh(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Float2)})"); - - /// - /// Returns the hyperbolic cosine of the specified value - /// - /// The specified value, radians - /// The hyperbolic cosine of the parameter - [Pure] - public static Float3 Cosh(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Float3)})"); - - /// - /// Returns the hyperbolic cosine of the specified value - /// - /// The specified value, radians - /// The hyperbolic cosine of the parameter - [Pure] - public static Float3 Cosh(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Float4)})"); - - /// - /// Returns the hyperbolic cosine of the specified value - /// - /// The specified value, radians - /// The hyperbolic cosine of the parameter - [Pure] - public static Vector2 Cosh(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector2)})"); - - /// - /// Returns the hyperbolic cosine of the specified value - /// - /// The specified value, radians - /// The hyperbolic cosine of the parameter - [Pure] - public static Vector3 Cosh(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector3)})"); - - /// - /// Returns the hyperbolic cosine of the specified value - /// - /// The specified value, radians - /// The hyperbolic cosine of the parameter - [Pure] - public static Vector3 Cosh(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cosh)}({nameof(Vector4)})"); - - /// - /// Counts the number of bits in the input value - /// - /// The input value - /// The number of bits - [Pure] - public static uint CountBits(uint x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(CountBits)}(uint)"); - - /// - /// Returns the cross product of two values - /// - /// The first vector - /// The second vector - /// The cross product of the parameter and the parameter - [Pure] - public static Float3 Cross(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cross)}({nameof(Float3)})"); - - /// - /// Returns the cross product of two values - /// - /// The first vector - /// The second vector - /// The cross product of the parameter and the parameter - [Pure] - public static Vector3 Cross(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Cross)}({nameof(Vector3)})"); - - /// - /// Converts the specified value from radians to degrees - /// - /// The specified value - /// The result of converting the parameter from radians to degrees - [Pure] - public static float Degrees(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}(float)"); - - /// - /// Converts the specified value from radians to degrees - /// - /// The specified value - /// The result of converting the parameter from radians to degrees - [Pure] - public static Float2 Degrees(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Float2)})"); - - /// - /// Converts the specified value from radians to degrees - /// - /// The specified value - /// The result of converting the parameter from radians to degrees - [Pure] - public static Float3 Degrees(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Float3)})"); - - /// - /// Converts the specified value from radians to degrees - /// - /// The specified value - /// The result of converting the parameter from radians to degrees - [Pure] - public static Float3 Degrees(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Float4)})"); - - /// - /// Converts the specified value from radians to degrees - /// - /// The specified value - /// The result of converting the parameter from radians to degrees - [Pure] - public static Vector2 Degrees(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector2)})"); - - /// - /// Converts the specified value from radians to degrees - /// - /// The specified value - /// The result of converting the parameter from radians to degrees - [Pure] - public static Vector3 Degrees(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector3)})"); - - /// - /// Converts the specified value from radians to degrees - /// - /// The specified value - /// The result of converting the parameter from radians to degrees - [Pure] - public static Vector3 Degrees(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Degrees)}({nameof(Vector4)})"); - - /// - /// Returns a distance scalar between two values - /// - /// The first value to compare - /// The second value to compare - /// A scalar value that represents the distance between the parameter and the parameter - [Pure] - public static float Distance(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns a distance scalar between two values - /// - /// The first value to compare - /// The second value to compare - /// A scalar value that represents the distance between the parameter and the parameter - [Pure] - public static float Distance(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns a distance scalar between two values - /// - /// The first value to compare - /// The second value to compare - /// A scalar value that represents the distance between the parameter and the parameter - [Pure] - public static float Distance(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns a distance scalar between two values - /// - /// The first value to compare - /// The second value to compare - /// A scalar value that represents the distance between the parameter and the parameter - [Pure] - public static float Distance(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns a distance scalar between two values - /// - /// The first value to compare - /// The second value to compare - /// A scalar value that represents the distance between the parameter and the parameter - [Pure] - public static float Distance(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns a distance scalar between two values - /// - /// The first value to compare - /// The second value to compare - /// A scalar value that represents the distance between the parameter and the parameter - [Pure] - public static float Distance(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Distance)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the dot product of two values - /// - /// The first vector - /// The second vector - /// The dot product of the parameter and the parameter - [Pure] - public static float Dot(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns the dot product of two values - /// - /// The first vector - /// The second vector - /// The dot product of the parameter and the parameter - [Pure] - public static float Dot(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns the dot product of two values - /// - /// The first vector - /// The second vector - /// The dot product of the parameter and the parameter - [Pure] - public static float Dot(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns the dot product of two values - /// - /// The first vector - /// The second vector - /// The dot product of the parameter and the parameter - [Pure] - public static float Dot(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns the dot product of two values - /// - /// The first vector - /// The second vector - /// The dot product of the parameter and the parameter - [Pure] - public static float Dot(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns the dot product of two values - /// - /// The first vector - /// The second vector - /// The dot product of the parameter and the parameter - [Pure] - public static float Dot(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Dot)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the base-e exponential of the specified value - /// - /// The specified value - /// The base-e exponential of the parameter - [Pure] - public static float Exp(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}(float)"); - - /// - /// Returns the base-e exponential of the specified value - /// - /// The specified value - /// The base-e exponential of the parameter - [Pure] - public static Float2 Exp(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Float2)})"); - - /// - /// Returns the base-e exponential of the specified value - /// - /// The specified value - /// The base-e exponential of the parameter - [Pure] - public static Float3 Exp(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Float3)})"); - - /// - /// Returns the base-e exponential of the specified value - /// - /// The specified value - /// The base-e exponential of the parameter - [Pure] - public static Float4 Exp(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Float4)})"); - - /// - /// Returns the base-e exponential of the specified value - /// - /// The specified value - /// The base-e exponential of the parameter - [Pure] - public static Vector2 Exp(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector2)})"); - - /// - /// Returns the base-e exponential of the specified value - /// - /// The specified value - /// The base-e exponential of the parameter - [Pure] - public static Vector3 Exp(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector3)})"); - - /// - /// Returns the base-e exponential of the specified value - /// - /// The specified value - /// The base-e exponential of the parameter - [Pure] - public static Vector4 Exp(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp)}({nameof(Vector4)})"); - - /// - /// Returns the base-2 exponential of the specified value - /// - /// The specified value - /// The base-2 exponential of the parameter - [Pure] - public static float Exp2(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}(float)"); - - /// - /// Returns the base-2 exponential of the specified value - /// - /// The specified value - /// The base-2 exponential of the parameter - [Pure] - public static Float2 Exp2(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Float2)})"); - - /// - /// Returns the base-2 exponential of the specified value - /// - /// The specified value - /// The base-2 exponential of the parameter - [Pure] - public static Float3 Exp2(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Float3)})"); - - /// - /// Returns the base-2 exponential of the specified value - /// - /// The specified value - /// The base-2 exponential of the parameter - [Pure] - public static Float4 Exp2(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Float4)})"); - - /// - /// Returns the base-2 exponential of the specified value - /// - /// The specified value - /// The base-2 exponential of the parameter - [Pure] - public static Vector2 Exp2(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector2)})"); - - /// - /// Returns the base-2 exponential of the specified value - /// - /// The specified value - /// The base-2 exponential of the parameter - [Pure] - public static Vector3 Exp2(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector3)})"); - - /// - /// Returns the base-2 exponential of the specified value - /// - /// The specified value - /// The base-2 exponential of the parameter - [Pure] - public static Vector4 Exp2(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Exp2)}({nameof(Vector4)})"); - - /// - /// Returns the largest integer that is less than or equal to the specified value - /// - /// The specified value - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter - [Pure] - public static float Floor(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}(float)"); - - /// - /// Returns the largest integer that is less than or equal to the specified value - /// - /// The specified value - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter - [Pure] - public static Float2 Floor(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Float2)})"); - - /// - /// Returns the largest integer that is less than or equal to the specified value - /// - /// The specified value - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter - [Pure] - public static Float3 Floor(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Float3)})"); - - /// - /// Returns the largest integer that is less than or equal to the specified value - /// - /// The specified value - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter - [Pure] - public static Float4 Floor(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Float4)})"); - - /// - /// Returns the largest integer that is less than or equal to the specified value - /// - /// The specified value - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter - [Pure] - public static Vector2 Floor(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector2)})"); - - /// - /// Returns the largest integer that is less than or equal to the specified value - /// - /// The specified value - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter - [Pure] - public static Vector3 Floor(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector3)})"); - - /// - /// Returns the largest integer that is less than or equal to the specified value - /// - /// The specified value - /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter - [Pure] - public static Vector4 Floor(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Floor)}({nameof(Vector4)})"); - - /// - /// Returns the floating-point remainder of / - /// - /// The divident - /// The divisor - /// The floating-point remainder of the parameter divided by the parameter - [Pure] - public static float Fmod(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}(float)"); - - /// - /// Returns the floating-point remainder of / - /// - /// The divident - /// The divisor - /// The floating-point remainder of the parameter divided by the parameter - [Pure] - public static Float2 Fmod(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns the floating-point remainder of / - /// - /// The divident - /// The divisor - /// The floating-point remainder of the parameter divided by the parameter - [Pure] - public static Float3 Fmod(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns the floating-point remainder of / - /// - /// The divident - /// The divisor - /// The floating-point remainder of the parameter divided by the parameter - [Pure] - public static Float4 Fmod(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns the floating-point remainder of / - /// - /// The divident - /// The divisor - /// The floating-point remainder of the parameter divided by the parameter - [Pure] - public static Vector2 Fmod(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns the floating-point remainder of / - /// - /// The divident - /// The divisor - /// The floating-point remainder of the parameter divided by the parameter - [Pure] - public static Vector3 Fmod(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns the floating-point remainder of / - /// - /// The divident - /// The divisor - /// The floating-point remainder of the parameter divided by the parameter - [Pure] - public static Vector4 Fmod(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Fmod)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 - /// - /// The specified value - /// The fractional part of the parameter - [Pure] - public static float Frac(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}(float)"); - - /// - /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 - /// - /// The specified value - /// The fractional part of the parameter - [Pure] - public static Float2 Frac(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Float2)})"); - - /// - /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 - /// - /// The specified value - /// The fractional part of the parameter - [Pure] - public static Float3 Frac(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Float3)})"); - - /// - /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 - /// - /// The specified value - /// The fractional part of the parameter - [Pure] - public static Float4 Frac(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Float4)})"); - - /// - /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 - /// - /// The specified value - /// The fractional part of the parameter - [Pure] - public static Vector2 Frac(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector2)})"); - - /// - /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 - /// - /// The specified value - /// The fractional part of the parameter - [Pure] - public static Vector3 Frac(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector3)})"); - - /// - /// Returns the fractional (or decimal) part of , which is greater than or equal to 0 and less than 1 - /// - /// The specified value - /// The fractional part of the parameter - [Pure] - public static Vector4 Frac(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Vector4)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value - /// - /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) - /// The returned exponent of the parameter - /// The fractional part of the parameter - [Pure] - public static float Frexp(float x, out float exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}(float,float)"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value - /// - /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) - /// The returned exponent of the parameter - /// The fractional part of the parameter - [Pure] - public static Float2 Frexp(Float2 x, out Float2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value - /// - /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) - /// The returned exponent of the parameter - /// The fractional part of the parameter - [Pure] - public static Float3 Frexp(Float3 x, out Float3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frac)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value - /// - /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) - /// The returned exponent of the parameter - /// The fractional part of the parameter - [Pure] - public static Float4 Frexp(Float4 x, out Float4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value - /// - /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) - /// The returned exponent of the parameter - /// The fractional part of the parameter - [Pure] - public static Vector2 Frexp(Vector2 x, out Vector2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value - /// - /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) - /// The returned exponent of the parameter - /// The fractional part of the parameter - [Pure] - public static Vector3 Frexp(Vector3 x, out Vector3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns the mantissa and exponent of the specified floating-point value - /// - /// The specified floating-point value (if the x parameter is 0, this function returns 0 for both the mantissa and the exponent) - /// The returned exponent of the parameter - /// The fractional part of the parameter - [Pure] - public static Vector4 Frexp(Vector4 x, out Vector4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Frexp)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value - [PreserveMemberName] - public static void InterlockedAdd(int destination, int value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAdd)}(int,int)"); - - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value - [PreserveMemberName] - public static void InterlockedAdd(uint destination, uint value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAdd)}(uint,uint)"); - - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value - /// The original input value - [PreserveMemberName] - public static void InterlockedAdd(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAdd)}(int,int,int)"); - - /// - /// Performs a guaranteed atomic add of a value to a destination. - /// - /// The destination value. - /// The input value - /// The original input value - [PreserveMemberName] - public static void InterlockedAdd(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAdd)}(uint,uint,uint)"); - - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value - [PreserveMemberName] - public static void InterlockedAnd(int destination, int value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAnd)}(int,int)"); - - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value - [PreserveMemberName] - public static void InterlockedAnd(uint destination, uint value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAnd)}(uint,uint)"); - - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value - /// The original input value - [PreserveMemberName] - public static void InterlockedAnd(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAnd)}(int,int,int)"); - - /// - /// Performs a guaranteed atomic and of a value to a destination. - /// - /// The destination value. - /// The input value - /// The original input value - [PreserveMemberName] - public static void InterlockedAnd(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedAnd)}(uint,uint,uint)"); - - /// - /// Atomically compares the destination with the comparison value. If they are identical, the destination - /// is overwritten with the input value. The original value is set to the destination's original value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedCompareExchange(int destination, int comparison, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedCompareExchange)}(int,int,int,int)"); - - /// - /// Atomically compares the destination with the comparison value. If they are identical, the destination - /// is overwritten with the input value. The original value is set to the destination's original value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedCompareExchange(uint destination, uint comparison, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedCompareExchange)}(uint,uint,uint,uint)"); - - /// - /// Atomically compares the destination to the comparison value. If they - /// are identical, the destination is overwritten with the input value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - [PreserveMemberName] - public static void InterlockedCompareStore(int destination, int comparison, int value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedCompareStore)}(int,int,int)"); - - /// - /// Atomically compares the destination to the comparison value. If they - /// are identical, the destination is overwritten with the input value. - /// - /// The destination value. - /// The comparison value. - /// The input value. - [PreserveMemberName] - public static void InterlockedCompareStore(uint destination, uint comparison, uint value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedCompareStore)}(uint,uint,uint)"); - - /// - /// Assigns value to dest and returns the original value. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedExchange(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedExchange)}(int,int,int)"); - - /// - /// Assigns value to dest and returns the original value. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedExchange(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedExchange)}(uint,uint,uint)"); - - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedMax(int destination, int value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMax)}(int,int)"); - - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedMax(uint destination, uint value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMax)}(uint,uint)"); - - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedMax(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMax)}(int,int,int)"); - - /// - /// Performs a guaranteed atomic max. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedMax(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMax)}(uint,uint,uint)"); - - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedMin(int destination, int value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMin)}(int,int)"); - - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedMin(uint destination, uint value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMin)}(uint,uint)"); - - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedMin(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMin)}(int,int,int)"); - - /// - /// Performs a guaranteed atomic min. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedMin(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedMin)}(uint,uint,uint)"); - - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedOr(int destination, int value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedOr)}(int,int)"); - - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedOr(uint destination, uint value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedOr)}(uint,uint)"); - - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedOr(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedOr)}(int,int,int)"); - - /// - /// Performs a guaranteed atomic or. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedOr(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedOr)}(uint,uint,uint)"); - - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedXor(int destination, int value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedXor)}(int,int)"); - - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - [PreserveMemberName] - public static void InterlockedXor(uint destination, uint value) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedXor)}(uint,uint)"); - - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedXor(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedXor)}(int,int,int)"); - - /// - /// Performs a guaranteed atomic xor. - /// - /// The destination value. - /// The input value. - /// The original value. - [PreserveMemberName] - public static void InterlockedXor(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(InterlockedXor)}(uint,uint,uint)"); - - /// - /// Determines if the specified floating-point value is finite - /// - /// The specified value - /// Returns if the parameter is finite, otherwise - [Pure] - public static bool IsFinite(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsFinite)}(float)"); - - /// - /// Determines if the specified floating-point value is infinite - /// - /// The specified value - /// Returns if the parameter is infinite, otherwise - [Pure] - public static bool IsInfinite(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsInfinite)}(float)"); - - /// - /// Determines if the specified floating-point value is - /// - /// The specified value - /// Returns if the parameter is , otherwise - [Pure] - public static bool IsNaN(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(IsNaN)}(float)"); - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent - /// - /// The specified value - /// The specified exponent - /// The result of multiplying the parameter by two, raised to the power of the parameter - [Pure] - public static float Ldexp(float x, float exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}(float)"); - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent - /// - /// The specified value - /// The specified exponent - /// The result of multiplying the parameter by two, raised to the power of the parameter - [Pure] - public static Float2 Ldexp(Float2 x, Float2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent - /// - /// The specified value - /// The specified exponent - /// The result of multiplying the parameter by two, raised to the power of the parameter - [Pure] - public static Float3 Ldexp(Float3 x, Float3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent - /// - /// The specified value - /// The specified exponent - /// The result of multiplying the parameter by two, raised to the power of the parameter - [Pure] - public static Float4 Ldexp(Float4 x, Float4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent - /// - /// The specified value - /// The specified exponent - /// The result of multiplying the parameter by two, raised to the power of the parameter - [Pure] - public static Vector2 Ldexp(Vector2 x, Vector2 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent - /// - /// The specified value - /// The specified exponent - /// The result of multiplying the parameter by two, raised to the power of the parameter - [Pure] - public static Vector3 Ldexp(Vector3 x, Vector3 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent - /// - /// The specified value - /// The specified exponent - /// The result of multiplying the parameter by two, raised to the power of the parameter - [Pure] - public static Vector4 Ldexp(Vector4 x, Vector4 exp) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Ldexp)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Performs a linear interpolation - /// - /// The first value - /// The second value - /// A value that linearly interpolates between the parameter and the parameter - /// The result of the linear interpolation - [Pure] - public static float Lerp(float x, float y, float s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Lerp)}(float,float,float)"); - - /// - /// Performs a linear interpolation - /// - /// The first value - /// The second value - /// A value that linearly interpolates between the parameter and the parameter - /// The result of the linear interpolation - [Pure] - public static Float2 Lerp(Float2 x, Float2 y, Float2 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Lerp)}({nameof(Float2)},{nameof(Float2)},{nameof(Float2)})"); - - /// - /// Performs a linear interpolation - /// - /// The first value - /// The second value - /// A value that linearly interpolates between the parameter and the parameter - /// The result of the linear interpolation - [Pure] - public static Float3 Lerp(Float3 x, Float3 y, Float3 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Lerp)}({nameof(Float3)},{nameof(Float3)},{nameof(Float3)})"); - - /// - /// Performs a linear interpolation - /// - /// The first value - /// The second value - /// A value that linearly interpolates between the parameter and the parameter - /// The result of the linear interpolation - [Pure] - public static Float2 Lerp(Float4 x, Float4 y, Float4 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Lerp)}({nameof(Float4)},{nameof(Float4)},{nameof(Float4)})"); - - /// - /// Performs a linear interpolation - /// - /// The first value - /// The second value - /// A value that linearly interpolates between the parameter and the parameter - /// The result of the linear interpolation - [Pure] - public static Vector2 Lerp(Vector2 x, Vector2 y, Vector2 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Lerp)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Performs a linear interpolation - /// - /// The first value - /// The second value - /// A value that linearly interpolates between the parameter and the parameter - /// The result of the linear interpolation - [Pure] - public static Vector3 Lerp(Vector3 x, Vector3 y, Vector3 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Lerp)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Performs a linear interpolation - /// - /// The first value - /// The second value - /// A value that linearly interpolates between the parameter and the parameter - /// The result of the linear interpolation - [Pure] - public static Vector2 Lerp(Vector4 x, Vector4 y, Vector4 s) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Lerp)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the base-e logarithm of the specified value - /// - /// The specified value - /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static float Log(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}(float)"); - - /// - /// Returns the base-e logarithm of the specified value - /// - /// The specified value - /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float2 Log(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Float2)})"); - - /// - /// Returns the base-e logarithm of the specified value - /// - /// The specified value - /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float3 Log(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Float3)})"); - - /// - /// Returns the base-e logarithm of the specified value - /// - /// The specified value - /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float4 Log(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Float4)})"); - - /// - /// Returns the base-e logarithm of the specified value - /// - /// The specified value - /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector2 Log(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector2)})"); - - /// - /// Returns the base-e logarithm of the specified value - /// - /// The specified value - /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector3 Log(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector3)})"); - - /// - /// Returns the base-e logarithm of the specified value - /// - /// The specified value - /// The base-e logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector4 Log(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log)}({nameof(Vector4)})"); - - /// - /// Returns the base-10 logarithm of the specified value - /// - /// The specified value - /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static float Log10(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}(float)"); - - /// - /// Returns the base-10 logarithm of the specified value - /// - /// The specified value - /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float2 Log10(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Float2)})"); - - /// - /// Returns the base-10 logarithm of the specified value - /// - /// The specified value - /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float3 Log10(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Float3)})"); - - /// - /// Returns the base-10 logarithm of the specified value - /// - /// The specified value - /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float4 Log10(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Float4)})"); - - /// - /// Returns the base-10 logarithm of the specified value - /// - /// The specified value - /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector2 Log10(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector2)})"); - - /// - /// Returns the base-10 logarithm of the specified value - /// - /// The specified value - /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector3 Log10(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector3)})"); - - /// - /// Returns the base-10 logarithm of the specified value - /// - /// The specified value - /// The base-10 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector4 Log10(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log10)}({nameof(Vector4)})"); - - /// - /// Returns the base-2 logarithm of the specified value - /// - /// The specified value - /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static float Log2(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}(float)"); - - /// - /// Returns the base-2 logarithm of the specified value - /// - /// The specified value - /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float2 Log2(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Float2)})"); - - /// - /// Returns the base-2 logarithm of the specified value - /// - /// The specified value - /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float3 Log2(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Float3)})"); - - /// - /// Returns the base-2 logarithm of the specified value - /// - /// The specified value - /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Float4 Log2(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Float4)})"); - - /// - /// Returns the base-2 logarithm of the specified value - /// - /// The specified value - /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector2 Log2(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector2)})"); - - /// - /// Returns the base-2 logarithm of the specified value - /// - /// The specified value - /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector3 Log2(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector3)})"); - - /// - /// Returns the base-2 logarithm of the specified value - /// - /// The specified value - /// The base-2 logarithm of the parameter (if parameter is negative this function returns indefinite, and if is 0, this function returns -INF) - [Pure] - public static Vector4 Log2(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Log2)}({nameof(Vector4)})"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected - [Pure] - public static int Max(int x, int y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}(int,int)"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static float Max(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}(float,float)"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Float2 Max(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Float3 Max(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Float4 Max(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Vector2 Max(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Vector3 Max(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Selects the greater of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the largest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Vector4 Max(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Max)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected - [Pure] - public static int Min(int x, int y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}(int,int)"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static float Min(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}(float,float)"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Float2 Min(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Float3 Min(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Float4 Min(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Vector2 Min(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Vector3 Min(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Selects the lesser of and - /// - /// The first specified value - /// The second specified exponent - /// The or parameter, whichever is the smallest value - /// For values of -INF or INF, will behave as expected, but for for values of , the results are undefined - [Pure] - public static Vector4 Min(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Min)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static int Modf(int x, out int ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(int,int)"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Int2 Modf(Int2 x, out Int2 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Int2)},{nameof(Int2)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Int3 Modf(Int3 x, out Int3 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Int3)},{nameof(Int3)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Int4 Modf(Int4 x, out Int4 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Int4)},{nameof(Int4)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static float Modf(float x, out float ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}(float,float)"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Float2 Modf(Float2 x, out Float2 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Float3 Modf(Float3 x, out Float3 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Float4 Modf(Float4 x, out Float4 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Vector2 Modf(Vector2 x, out Vector2 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Vector3 Modf(Vector3 x, out Vector3 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Splits the value into fractional and integer parts, each of which has the same sign as - /// - /// The input value - /// The integer portion of - /// The signed-fractional portion of - [Pure] - public static Vector4 Modf(Vector4 x, out Vector4 ip) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Modf)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Float2 Mul(float x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Float2)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Float3 Mul(float x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Float3)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Float3 Mul(float x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Float4)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Vector2 Mul(float x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector2)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Vector3 Mul(float x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector3)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Vector3 Mul(float x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}(float,{nameof(Vector4)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Float2 Mul(Float2 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Float2)},float)"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Float3 Mul(Float3 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Float3)},float)"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Float4 Mul(Float4 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Float4)},float)"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Vector2 Mul(Vector2 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector2)},float)"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Vector3 Mul(Vector3 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector3)},float)"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static Vector4 Mul(Vector4 x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector4)},float)"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static float Mul(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static float Mul(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static float Mul(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static float Mul(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static float Mul(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Multiplies and using matrix math - /// - /// The first input value (if is a vector, it treated as a row vector) - /// The second input value (if is a vector, it treated as a column vector) - /// The result of times - [Pure] - public static float Mul(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Mul)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Normalizes the specified floating-point vector according to / length() - /// - /// The specified value - /// The normalized parameter - [Pure] - public static Float2 Normalize(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Float2)})"); - - /// - /// Normalizes the specified floating-point vector according to / length() - /// - /// The specified value - /// The normalized parameter - [Pure] - public static Float3 Normalize(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Float3)})"); - - /// - /// Normalizes the specified floating-point vector according to / length() - /// - /// The specified value - /// The normalized parameter - [Pure] - public static Float4 Normalize(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Float4)})"); - - /// - /// Normalizes the specified floating-point vector according to / length() - /// - /// The specified value - /// The normalized parameter - [Pure] - public static Vector2 Normalize(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector2)})"); - - /// - /// Normalizes the specified floating-point vector according to / length() - /// - /// The specified value - /// The normalized parameter - [Pure] - public static Vector3 Normalize(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector3)})"); - - /// - /// Normalizes the specified floating-point vector according to / length() - /// - /// The specified value - /// The normalized parameter - [Pure] - public static Vector4 Normalize(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Normalize)}({nameof(Vector4)})"); - - /// - /// Returns the specified value raised to the specified power - /// - /// The specified value - /// The specified power - /// The parameter raised to the power of the parameter - /// See for details on special cases - [Pure] - public static float Pow(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}(float,float)"); - - /// - /// Returns the specified value raised to the specified power - /// - /// The specified value - /// The specified power - /// The parameter raised to the power of the parameter - /// See for details on special cases - [Pure] - public static Float2 Pow(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns the specified value raised to the specified power - /// - /// The specified value - /// The specified power - /// The parameter raised to the power of the parameter - /// See for details on special cases - [Pure] - public static Float3 Pow(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns the specified value raised to the specified power - /// - /// The specified value - /// The specified power - /// The parameter raised to the power of the parameter - /// See for details on special cases - [Pure] - public static Float4 Pow(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns the specified value raised to the specified power - /// - /// The specified value - /// The specified power - /// The parameter raised to the power of the parameter - /// See for details on special cases - [Pure] - public static Vector2 Pow(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns the specified value raised to the specified power - /// - /// The specified value - /// The specified power - /// The parameter raised to the power of the parameter - /// See for details on special cases - [Pure] - public static Vector3 Pow(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns the specified value raised to the specified power - /// - /// The specified value - /// The specified power - /// The parameter raised to the power of the parameter - /// See for details on special cases - [Pure] - public static Vector4 Pow(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Pow)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Converts the specified value from degrees to radians - /// - /// The specified value - /// The parameter converted from degrees to radians - [Pure] - public static float Radians(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}(float)"); - - /// - /// Converts the specified value from degrees to radians - /// - /// The specified value - /// The parameter converted from degrees to radians - [Pure] - public static Float2 Radians(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Float2)})"); - - /// - /// Converts the specified value from degrees to radians - /// - /// The specified value - /// The parameter converted from degrees to radians - [Pure] - public static Float3 Radians(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Float3)})"); - - /// - /// Converts the specified value from degrees to radians - /// - /// The specified value - /// The parameter converted from degrees to radians - [Pure] - public static Float4 Radians(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Float4)})"); - - /// - /// Converts the specified value from degrees to radians - /// - /// The specified value - /// The parameter converted from degrees to radians - [Pure] - public static Vector2 Radians(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector2)})"); - - /// - /// Converts the specified value from degrees to radians - /// - /// The specified value - /// The parameter converted from degrees to radians - [Pure] - public static Vector3 Radians(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector3)})"); - - /// - /// Converts the specified value from degrees to radians - /// - /// The specified value - /// The parameter converted from degrees to radians - [Pure] - public static Vector4 Radians(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Radians)}({nameof(Vector4)})"); - - /// - /// Calculates a fast, approximate reciprocal of a given value - /// - /// The specified value - /// The reciprocal of the parameter - [Pure] - public static float Rcp(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}(float)"); - - /// - /// Calculates a fast, approximate, per-component reciprocal - /// - /// The specified value - /// The reciprocal of the parameter - [Pure] - public static Float2 Rcp(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Float2)})"); - - /// - /// Calculates a fast, approximate, per-component reciprocal - /// - /// The specified value - /// The reciprocal of the parameter - [Pure] - public static Float3 Rcp(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Float3)})"); - - /// - /// Calculates a fast, approximate, per-component reciprocal - /// - /// The specified value - /// The reciprocal of the parameter - [Pure] - public static Float4 Rcp(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Float4)})"); - - /// - /// Calculates a fast, approximate, per-component reciprocal - /// - /// The specified value - /// The reciprocal of the parameter - [Pure] - public static Vector2 Rcp(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector2)})"); - - /// - /// Calculates a fast, approximate, per-component reciprocal - /// - /// The specified value - /// The reciprocal of the parameter - [Pure] - public static Vector3 Rcp(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector3)})"); - - /// - /// Calculates a fast, approximate, per-component reciprocal - /// - /// The specified value - /// The reciprocal of the parameter - [Pure] - public static Vector4 Rcp(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rcp)}({nameof(Vector4)})"); - - /// - /// Rounds the specified value to the nearest integer - /// - /// The specified value - /// The parameter, rounded to the nearest integer within a floating-point type - [Pure] - public static float Round(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}(float)"); - - /// - /// Rounds the specified value to the nearest integer - /// - /// The specified value - /// The parameter, rounded to the nearest integer within a floating-point type - [Pure] - public static Float2 Round(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Float2)})"); - - /// - /// Rounds the specified value to the nearest integer - /// - /// The specified value - /// The parameter, rounded to the nearest integer within a floating-point type - [Pure] - public static Float3 Round(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Float3)})"); - - /// - /// Rounds the specified value to the nearest integer - /// - /// The specified value - /// The parameter, rounded to the nearest integer within a floating-point type - [Pure] - public static Float4 Round(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Float4)})"); - - /// - /// Rounds the specified value to the nearest integer - /// - /// The specified value - /// The parameter, rounded to the nearest integer within a floating-point type - [Pure] - public static Vector2 Round(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector2)})"); - - /// - /// Rounds the specified value to the nearest integer - /// - /// The specified value - /// The parameter, rounded to the nearest integer within a floating-point type - [Pure] - public static Vector3 Round(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector3)})"); - - /// - /// Rounds the specified value to the nearest integer - /// - /// The specified value - /// The parameter, rounded to the nearest integer within a floating-point type - [Pure] - public static Vector4 Round(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Round)}({nameof(Vector4)})"); - - /// - /// Returns the reciprocal of the square root of the specified value - /// - /// The specified value - /// The reciprocal of the square root of the parameter - /// This function uses the following formula: 1 / sqrt() - [Pure] - public static float Rsqrt(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}(float)"); - - /// - /// Returns the reciprocal of the square root of the specified value - /// - /// The specified value - /// The reciprocal of the square root of the parameter - /// This function uses the following formula: 1 / sqrt() - [Pure] - public static Float2 Rsqrt(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Float2)})"); - - /// - /// Returns the reciprocal of the square root of the specified value - /// - /// The specified value - /// The reciprocal of the square root of the parameter - /// This function uses the following formula: 1 / sqrt() - [Pure] - public static Float3 Rsqrt(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Float3)})"); - - /// - /// Returns the reciprocal of the square root of the specified value - /// - /// The specified value - /// The reciprocal of the square root of the parameter - /// This function uses the following formula: 1 / sqrt() - [Pure] - public static Float4 Rsqrt(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Float4)})"); - - /// - /// Returns the reciprocal of the square root of the specified value - /// - /// The specified value - /// The reciprocal of the square root of the parameter - /// This function uses the following formula: 1 / sqrt() - [Pure] - public static Vector2 Rsqrt(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector2)})"); - - /// - /// Returns the reciprocal of the square root of the specified value - /// - /// The specified value - /// The reciprocal of the square root of the parameter - /// This function uses the following formula: 1 / sqrt() - [Pure] - public static Vector3 Rsqrt(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector3)})"); - - /// - /// Returns the reciprocal of the square root of the specified value - /// - /// The specified value - /// The reciprocal of the square root of the parameter - /// This function uses the following formula: 1 / sqrt() - [Pure] - public static Vector4 Rsqrt(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Rsqrt)}({nameof(Vector4)})"); - - /// - /// Clamps the specified value within the range [0,1] - /// - /// The specified value - /// The parameter, clamped within the range [0,1] - [Pure] - public static float Saturate(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}(float)"); - - /// - /// Clamps the specified value within the range [0,1] - /// - /// The specified value - /// The parameter, clamped within the range [0,1] - [Pure] - public static Float2 Saturate(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Float2)})"); - - /// - /// Clamps the specified value within the range [0,1] - /// - /// The specified value - /// The parameter, clamped within the range [0,1] - [Pure] - public static Float3 Saturate(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Float3)})"); - - /// - /// Clamps the specified value within the range [0,1] - /// - /// The specified value - /// The parameter, clamped within the range [0,1] - [Pure] - public static Float4 Saturate(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Float4)})"); - - /// - /// Clamps the specified value within the range [0,1] - /// - /// The specified value - /// The parameter, clamped within the range [0,1] - [Pure] - public static Vector2 Saturate(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector2)})"); - - /// - /// Clamps the specified value within the range [0,1] - /// - /// The specified value - /// The parameter, clamped within the range [0,1] - [Pure] - public static Vector3 Saturate(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector3)})"); - - /// - /// Clamps the specified value within the range [0,1] - /// - /// The specified value - /// The parameter, clamped within the range [0,1] - [Pure] - public static Vector4 Saturate(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Saturate)}({nameof(Vector4)})"); - - /// - /// Returns the sign of - /// - /// The input value - /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero - [Pure] - public static float Sign(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}(float)"); - - /// - /// Returns the sign of - /// - /// The input value - /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero - [Pure] - public static Float2 Sign(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Float2)})"); - - /// - /// Returns the sign of - /// - /// The input value - /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero - [Pure] - public static Float3 Sign(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Float3)})"); - - /// - /// Returns the sign of - /// - /// The input value - /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero - [Pure] - public static Float4 Sign(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Float4)})"); - - /// - /// Returns the sign of - /// - /// The input value - /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero - [Pure] - public static Vector2 Sign(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector2)})"); - - /// - /// Returns the sign of - /// - /// The input value - /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero - [Pure] - public static Vector3 Sign(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector3)})"); - - /// - /// Returns the sign of - /// - /// The input value - /// Returns -1 if is less than zero, 0 if equals zero and 1 if is greater than zero - [Pure] - public static Vector4 Sign(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sign)}({nameof(Vector4)})"); - - /// - /// Returns the sine of the specified value - /// - /// The specified value, radians - /// The sine of the parameter - [Pure] - public static float Sin(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}(float)"); - - /// - /// Returns the sine of the specified value - /// - /// The specified value, radians - /// The sine of the parameter - [Pure] - public static Float2 Sin(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Float2)})"); - - /// - /// Returns the sine of the specified value - /// - /// The specified value, radians - /// The sine of the parameter - [Pure] - public static Float3 Sin(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Float3)})"); - - /// - /// Returns the sine of the specified value - /// - /// The specified value, radians - /// The sine of the parameter - [Pure] - public static Float4 Sin(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Float4)})"); - - /// - /// Returns the sine of the specified value - /// - /// The specified value, radians - /// The sine of the parameter - [Pure] - public static Vector2 Sin(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector2)})"); - - /// - /// Returns the sine of the specified value - /// - /// The specified value, radians - /// The sine of the parameter - [Pure] - public static Vector3 Sin(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector3)})"); - - /// - /// Returns the sine of the specified value - /// - /// The specified value, radians - /// The sine of the parameter - [Pure] - public static Vector4 Sin(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sin)}({nameof(Vector4)})"); - - /// - /// Returns the sine and cosine of - /// - /// The specified value, radians - /// Returns the sine of - /// Returns the cosine of - public static void SinCos(float x, out float s, out float c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}(float,float,float)"); - - /// - /// Returns the sine and cosine of - /// - /// The specified value, radians - /// Returns the sine of - /// Returns the cosine of - public static void SinCos(Float2 x, out Float2 s, out Float2 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Float2)},{nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns the sine and cosine of - /// - /// The specified value, radians - /// Returns the sine of - /// Returns the cosine of - public static void SinCos(Float3 x, out Float3 s, out Float3 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Float3)},{nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns the sine and cosine of - /// - /// The specified value, radians - /// Returns the sine of - /// Returns the cosine of - public static void SinCos(Float4 x, out Float4 s, out Float4 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Float4)},{nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns the sine and cosine of - /// - /// The specified value, radians - /// Returns the sine of - /// Returns the cosine of - public static void SinCos(Vector2 x, out Vector2 s, out Vector2 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns the sine and cosine of - /// - /// The specified value, radians - /// Returns the sine of - /// Returns the cosine of - public static void SinCos(Vector3 x, out Vector3 s, out Vector3 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns the sine and cosine of - /// - /// The specified value, radians - /// Returns the sine of - /// Returns the cosine of - public static void SinCos(Vector4 x, out Vector4 s, out Vector4 c) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SinCos)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the hyperbolic sine of the specified value - /// - /// The specified value, radians - /// The hyperbolic sine of the parameter - [Pure] - public static float Sinh(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}(float)"); - - /// - /// Returns the hyperbolic sine of the specified value - /// - /// The specified value, radians - /// The hyperbolic sine of the parameter - [Pure] - public static Float2 Sinh(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Float2)})"); - - /// - /// Returns the hyperbolic sine of the specified value - /// - /// The specified value, radians - /// The hyperbolic sine of the parameter - [Pure] - public static Float3 Sinh(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Float3)})"); - - /// - /// Returns the hyperbolic sine of the specified value - /// - /// The specified value, radians - /// The hyperbolic sine of the parameter - [Pure] - public static Float4 Sinh(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Float4)})"); - - /// - /// Returns the hyperbolic sine of the specified value - /// - /// The specified value, radians - /// The hyperbolic sine of the parameter - [Pure] - public static Vector2 Sinh(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector2)})"); - - /// - /// Returns the hyperbolic sine of the specified value - /// - /// The specified value, radians - /// The hyperbolic sine of the parameter - [Pure] - public static Vector3 Sinh(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector3)})"); - - /// - /// Returns the hyperbolic sine of the specified value - /// - /// The specified value, radians - /// The hyperbolic sine of the parameter - [Pure] - public static Vector4 Sinh(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sinh)}({nameof(Vector4)})"); - - /// - /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] - /// - /// The minimum range of the parameter - /// The maximum range of the parameter - /// The specified value to be interpolated - /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] - [Pure] - public static float SmoothStep(float min, float max, float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}(float,float,float)"); - - /// - /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] - /// - /// The minimum range of the parameter - /// The maximum range of the parameter - /// The specified value to be interpolated - /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] - [Pure] - public static Float2 SmoothStep(Float2 min, Float2 max, Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Float2)},{nameof(Float2)},{nameof(Float2)})"); - - /// - /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] - /// - /// The minimum range of the parameter - /// The maximum range of the parameter - /// The specified value to be interpolated - /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] - [Pure] - public static Float3 SmoothStep(Float3 min, Float3 max, Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Float3)},{nameof(Float3)},{nameof(Float3)})"); - - /// - /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] - /// - /// The minimum range of the parameter - /// The maximum range of the parameter - /// The specified value to be interpolated - /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] - [Pure] - public static Float4 SmoothStep(Float4 min, Float4 max, Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Float4)},{nameof(Float4)},{nameof(Float4)})"); - - /// - /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] - /// - /// The minimum range of the parameter - /// The maximum range of the parameter - /// The specified value to be interpolated - /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] - [Pure] - public static Vector2 SmoothStep(Vector2 min, Vector2 max, Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector2)},{nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] - /// - /// The minimum range of the parameter - /// The maximum range of the parameter - /// The specified value to be interpolated - /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] - [Pure] - public static Vector3 SmoothStep(Vector3 min, Vector3 max, Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector3)},{nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Returns a smooth Hermite interpolation between 0 and 1, if is in the range [, ] - /// - /// The minimum range of the parameter - /// The maximum range of the parameter - /// The specified value to be interpolated - /// 0 if is less than , 1 if is greater than , otherwise a value between 0 and 1 if is in the range [, ] - [Pure] - public static Vector4 SmoothStep(Vector4 min, Vector4 max, Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(SmoothStep)}({nameof(Vector4)},{nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the square root of the specified floating-point value - /// - /// The specified value - /// The square root of the parameter - [Pure] - public static float Sqrt(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}(float)"); - - /// - /// Returns the square root of the specified floating-point value, per component - /// - /// The specified value - /// The square root of the parameter, per component - [Pure] - public static Float2 Sqrt(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Float2)})"); - - /// - /// Returns the square root of the specified floating-point value, per component - /// - /// The specified value - /// The square root of the parameter, per component - [Pure] - public static Float3 Sqrt(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Float3)})"); - - /// - /// Returns the square root of the specified floating-point value, per component - /// - /// The specified value - /// The square root of the parameter, per component - [Pure] - public static Float4 Sqrt(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Float4)})"); - - /// - /// Returns the square root of the specified floating-point value, per component - /// - /// The specified value - /// The square root of the parameter, per component - [Pure] - public static Vector2 Sqrt(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector2)})"); - - /// - /// Returns the square root of the specified floating-point value, per component - /// - /// The specified value - /// The square root of the parameter, per component - [Pure] - public static Vector3 Sqrt(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector3)})"); - - /// - /// Returns the square root of the specified floating-point value, per component - /// - /// The specified value - /// The square root of the parameter, per component - [Pure] - public static Vector4 Sqrt(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Sqrt)}({nameof(Vector4)})"); - - /// - /// Compares two values, returning 0 or 1 based on which value is greater - /// - /// The first specified value to compare - /// The second specified value to compare - /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 - /// This function uses the following formula: (x >= y) ? 1 : 0 - [Pure] - public static float Step(float x, float y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}(float,float)"); - - /// - /// Compares two values, returning 0 or 1 based on which value is greater - /// - /// The first specified value to compare - /// The second specified value to compare - /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 - /// This function uses the following formula: (x >= y) ? 1 : 0 - [Pure] - public static Float2 Step(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Float2)},{nameof(Float2)})"); - - /// - /// Compares two values, returning 0 or 1 based on which value is greater - /// - /// The first specified value to compare - /// The second specified value to compare - /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 - /// This function uses the following formula: (x >= y) ? 1 : 0 - [Pure] - public static Float3 Step(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Float3)},{nameof(Float3)})"); - - /// - /// Compares two values, returning 0 or 1 based on which value is greater - /// - /// The first specified value to compare - /// The second specified value to compare - /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 - /// This function uses the following formula: (x >= y) ? 1 : 0 - [Pure] - public static Float4 Step(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Float4)},{nameof(Float4)})"); - - /// - /// Compares two values, returning 0 or 1 based on which value is greater - /// - /// The first specified value to compare - /// The second specified value to compare - /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 - /// This function uses the following formula: (x >= y) ? 1 : 0 - [Pure] - public static Vector2 Step(Vector2 x, Vector2 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector2)},{nameof(Vector2)})"); - - /// - /// Compares two values, returning 0 or 1 based on which value is greater - /// - /// The first specified value to compare - /// The second specified value to compare - /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 - /// This function uses the following formula: (x >= y) ? 1 : 0 - [Pure] - public static Vector3 Step(Vector3 x, Vector3 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector3)},{nameof(Vector3)})"); - - /// - /// Compares two values, returning 0 or 1 based on which value is greater - /// - /// The first specified value to compare - /// The second specified value to compare - /// 1 if the parameter is greater than or equal to the parameter, otherwise, 0 - /// This function uses the following formula: (x >= y) ? 1 : 0 - [Pure] - public static Vector4 Step(Vector4 x, Vector4 y) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Step)}({nameof(Vector4)},{nameof(Vector4)})"); - - /// - /// Returns the tangent of the specified value - /// - /// The specified value, radians - /// The tangent of the parameter - [Pure] - public static float Tan(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}(float)"); - - /// - /// Returns the tangent of the specified value - /// - /// The specified value, radians - /// The tangent of the parameter - [Pure] - public static Float2 Tan(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Float2)})"); - - /// - /// Returns the tangent of the specified value - /// - /// The specified value, radians - /// The tangent of the parameter - [Pure] - public static Float3 Tan(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Float3)})"); - - /// - /// Returns the tangent of the specified value - /// - /// The specified value, radians - /// The tangent of the parameter - [Pure] - public static Float4 Tan(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Float4)})"); - - /// - /// Returns the tangent of the specified value - /// - /// The specified value, radians - /// The tangent of the parameter - [Pure] - public static Vector2 Tan(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector2)})"); - - /// - /// Returns the tangent of the specified value - /// - /// The specified value, radians - /// The tangent of the parameter - [Pure] - public static Vector3 Tan(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector3)})"); - - /// - /// Returns the tangent of the specified value - /// - /// The specified value, radians - /// The tangent of the parameter - [Pure] - public static Vector4 Tan(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tan)}({nameof(Vector4)})"); - - /// - /// Returns the hyperbolic tangent of the specified value - /// - /// The specified value, radians - /// The hyperbolic tangent of the parameter - [Pure] - public static float Tanh(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}(float)"); - - /// - /// Returns the hyperbolic tangent of the specified value - /// - /// The specified value, radians - /// The hyperbolic tangent of the parameter - [Pure] - public static Float2 Tanh(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Float2)})"); - - /// - /// Returns the hyperbolic tangent of the specified value - /// - /// The specified value, radians - /// The hyperbolic tangent of the parameter - [Pure] - public static Float3 Tanh(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Float3)})"); - - /// - /// Returns the hyperbolic tangent of the specified value - /// - /// The specified value, radians - /// The hyperbolic tangent of the parameter - [Pure] - public static Float4 Tanh(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Float4)})"); - - /// - /// Returns the hyperbolic tangent of the specified value - /// - /// The specified value, radians - /// The hyperbolic tangent of the parameter - [Pure] - public static Vector2 Tanh(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector2)})"); - - /// - /// Returns the hyperbolic tangent of the specified value - /// - /// The specified value, radians - /// The hyperbolic tangent of the parameter - [Pure] - public static Vector3 Tanh(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector3)})"); - - /// - /// Returns the hyperbolic tangent of the specified value - /// - /// The specified value, radians - /// The hyperbolic tangent of the parameter - [Pure] - public static Vector4 Tanh(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Tanh)}({nameof(Vector4)})"); - - /// - /// Truncates a floating-point value to the integer component - /// - /// The specified value, radians - /// The parameter truncated to an integer component - [Pure] - public static float Trunc(float x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}(float)"); - - /// - /// Truncates a floating-point value to the integer component - /// - /// The specified value, radians - /// The parameter truncated to an integer component - [Pure] - public static Float2 Trunc(Float2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Float2)})"); - - /// - /// Truncates a floating-point value to the integer component - /// - /// The specified value, radians - /// The parameter truncated to an integer component - [Pure] - public static Float3 Trunc(Float3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Float3)})"); - - /// - /// Truncates a floating-point value to the integer component - /// - /// The specified value, radians - /// The parameter truncated to an integer component - [Pure] - public static Float4 Trunc(Float4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Float4)})"); - - /// - /// Truncates a floating-point value to the integer component - /// - /// The specified value, radians - /// The parameter truncated to an integer component - [Pure] - public static Vector2 Trunc(Vector2 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector2)})"); - - /// - /// Truncates a floating-point value to the integer component - /// - /// The specified value, radians - /// The parameter truncated to an integer component - [Pure] - public static Vector3 Trunc(Vector3 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector3)})"); - - /// - /// Truncates a floating-point value to the integer component - /// - /// The specified value, radians - /// The parameter truncated to an integer component - [Pure] - public static Vector4 Trunc(Vector4 x) => throw new InvalidExecutionContextException($"{nameof(Hlsl)}.{nameof(Trunc)}({nameof(Vector4)})"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs deleted file mode 100644 index bbdb8fc6..00000000 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool2.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y})")] - [StructLayout(LayoutKind.Explicit, Size = sizeof(int) * 2)] - public struct Bool2 - { - /// - /// Gets an value with all components set to - /// - public static Bool2 False => false; - - /// - /// Gets an value with all components set to - /// - public static Bool2 True => true; - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool2 TrueX => new Bool2(true, false); - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool2 TrueY => new Bool2(false, true); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - public Bool2(bool x, bool y) - { - _X = x; - _Y = y; - } - - [FieldOffset(0)] - private bool _X; - - /// - /// Gets or sets the value of the first vector component - /// - public bool X - { - get => _X; - set => _X = value; - } - - [FieldOffset(4)] - private bool _Y; - - /// - /// Gets or sets the value of the second vector component - /// - public bool Y - { - get => _Y; - set => _Y = value; - } - - /// - /// Gets or sets the value of the first color component - /// - public bool R - { - get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public bool G - { - get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(G)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public bool this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Bool2)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Bool2)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 XX => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XY)}"); - } - - /// - /// Gets an value with the and values - /// - public Bool2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 YY => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YY)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 RR => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RG)}"); - } - - /// - /// Gets an value with the and values - /// - public Bool2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 GG => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GG)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Bool2(bool x) => new Bool2(x, x); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs deleted file mode 100644 index 5766ffe4..00000000 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool3.cs +++ /dev/null @@ -1,587 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z})")] - [StructLayout(LayoutKind.Explicit, Size = sizeof(int) * 3)] - public struct Bool3 - { - /// - /// Gets an value with all components set to - /// - public static Bool3 False => false; - - /// - /// Gets an value with all components set to - /// - public static Bool3 True => true; - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool3 TrueX => new Bool3(true, false, false); - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool3 TrueY => new Bool3(false, true, false); - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool3 TrueZ => new Bool3(false, false, true); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - public Bool3(bool x, bool y, bool z) - { - _X = x; - _Y = y; - _Z = z; - } - - [FieldOffset(0)] - private bool _X; - - /// - /// Gets or sets the value of the first vector component - /// - public bool X - { - get => _X; - set => _X = value; - } - - [FieldOffset(4)] - private bool _Y; - - /// - /// Gets or sets the value of the second vector component - /// - public bool Y - { - get => _Y; - set => _Y = value; - } - - [FieldOffset(8)] - private bool _Z; - - /// - /// Gets or sets the value of the third vector component - /// - public bool Z - { - get => _Z; - set => _Z = value; - } - - /// - /// Gets or sets the value of the first color component - /// - public bool R - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public bool G - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public bool B - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(B)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public bool this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 XX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 YY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 ZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 RR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 GG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 BB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BB)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 XXX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 XXY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 XXZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 XYX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 XYY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 XZX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 XZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 YXX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 YXY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 YYX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 YYY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 YYZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 YZY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 YZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 ZXX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 ZXZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 ZYY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 ZYZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 ZZX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 ZZY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 ZZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 RRR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 RRG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 RRB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 RGR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 RGG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 RBR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 RBB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 GRR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 GRG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 GGR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 GGG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 GGB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 GBG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 GBB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 BRR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 BRB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool2 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool2 BGG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 BGB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 BBR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool2 BBG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 BBB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BBB)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Bool3(bool x) => new Bool3(x, x, x); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs b/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs deleted file mode 100644 index c731f5c7..00000000 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool4.cs +++ /dev/null @@ -1,3999 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] - [StructLayout(LayoutKind.Explicit, Size = sizeof(int) * 4)] - public struct Bool4 - { - /// - /// Gets an value with all components set to - /// - public static Bool4 False => false; - - /// - /// Gets an value with all components set to - /// - public static Bool4 True => true; - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool4 TrueX => new Bool4(true, false, false, false); - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool4 TrueY => new Bool4(false, true, false, false); - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool4 TrueZ => new Bool4(false, false, true, false); - - /// - /// Gets an value with the component set to , and the others to - /// - public static Bool4 TrueW => new Bool4(false, false, false, true); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - /// The value to assign to the fourth vector component - public Bool4(bool x, bool y, bool z, bool w) - { - _X = x; - _Y = y; - _Z = z; - _W = w; - } - - [FieldOffset(0)] - private bool _X; - - /// - /// Gets or sets the value of the first vector component - /// - public bool X - { - get => _X; - set => _X = value; - } - - [FieldOffset(4)] - private bool _Y; - - /// - /// Gets or sets the value of the second vector component - /// - public bool Y - { - get => _Y; - set => _Y = value; - } - - [FieldOffset(8)] - private bool _Z; - - /// - /// Gets or sets the value of the third vector component - /// - public bool Z - { - get => _Z; - set => _Z = value; - } - - [FieldOffset(12)] - private bool _W; - - /// - /// Gets or sets the value of the fourth vector component - /// - public bool W - { - get => _W; - set => _W = value; - } - - /// - /// Gets or sets the value of the first color component - /// - public bool R - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public bool G - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public bool B - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(B)}"); - } - - /// - /// Gets or sets the value of the fourth color component - /// - public bool A - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(A)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(A)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public bool this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 XX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 XW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 YY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 YW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 ZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZ)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 ZW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 WX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 WY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 WZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZ)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 WW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WW)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool2 RR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 RA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 GG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 GA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 BB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BB)}"); - - /// - /// Gets or sets an value with the and values - /// - public Bool2 BA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 AR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 AG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Bool2 AB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AB)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Bool2 AA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AA)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 XXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 XXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 XXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 XXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXW)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 XYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 XYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 XYW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 XZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 XZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 XZW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 XWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 XWY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 XWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 XWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWW)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 YXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 YXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 YXW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 YYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 YYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 YYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 YYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 YZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 YZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 YZW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 YWX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 YWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 YWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 YWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWW)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 ZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 ZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 ZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 ZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 ZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 ZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWW)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 WXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 WXY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 WXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 WXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 WYX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 WYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 WYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 WYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 WZX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 WZY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 WZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 WZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZW)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 WWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 WWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWY)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 WWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 WWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 RRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 RRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 RRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 RRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRA)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 RGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 RGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 RGA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 RBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 RBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 RBA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 RAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 RAG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 RAB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 RAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAA)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 GRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 GRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 GRA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 GGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 GGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 GGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 GGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 GBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 GBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 GBA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 GAR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 GAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 GAB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 GAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAA)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 BRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 BRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 BRA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 BGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 BGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 BGA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 BBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 BBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 BBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 BBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 BAR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 BAG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 BAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 BAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAA)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 ARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ARG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ARB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 ARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 AGR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 AGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 AGB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 AGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ABR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Bool3 ABG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Bool3 ABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABB)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 ABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABA)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 AAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 AAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAG)}"); - - /// - /// Gets an value with the , and values - /// - public Bool3 AAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool3 AAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAA)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 XXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XXYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XXZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XXWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XYZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XYZW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XYWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 XYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XWYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 XWZY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWZ)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 XWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YXZW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YXWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 YXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YYXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 YYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWX)}"); - - /// - /// Gets an value with the , and values - /// - public Bool4 YYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YWXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 YWZX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 YWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZXYW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZXWY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZYXW - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZYWX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZWXY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZWYX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WXYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WXZY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WYXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYX)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 WYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WYZX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WYWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 WWZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 WWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 RRRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RRGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RRBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RRAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RRAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RRAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RGBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RGBA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RGAB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 RGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RBGA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RBAG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RBAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RAGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RAGB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 RAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 RABG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 RABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 RAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAB)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 RAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GRBA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GRAB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 GRAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GGRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 GGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAR)}"); - - /// - /// Gets an value with the , and values - /// - public Bool4 GGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GGAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GBRA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 GBBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GBAR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GBAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GARB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 GARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 GABR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 GABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 GAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BRGA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BRAG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BRAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BGRA - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BGAR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 BBBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BBAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BBAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BARG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 BARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BAGR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 BAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BAGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 BABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 BAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ARGB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ARBG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ARAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ARAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 AGRB - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGR)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 AGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 AGBR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 AGAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ABRG - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ABGR - { - get => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Bool4 ABBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 ABAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 ABAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 AARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AAGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AAGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Bool4 AABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Bool4 AAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Bool4 AAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAA)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Bool4(bool x) => new Bool4(x, x, x, x); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Double/Double2.cs b/src/ComputeSharp.Core/Primitives/Double/Double2.cs deleted file mode 100644 index d7974f93..00000000 --- a/src/ComputeSharp.Core/Primitives/Double/Double2.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 2)] - public struct Double2 - { - /// - /// Gets an value with all components set to 0 - /// - public static Double2 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Double2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double2 UnitX => new Double2(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double2 UnitY => new Double2(0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - public Double2(double x, double y) - { - X = x; - Y = y; - } - - /// - /// Gets or sets the value of the first vector component - /// - public double X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public double Y { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public double R - { - get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public double G - { - get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(G)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public double this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Double2)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Double2)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 XX => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(XY)}"); - } - - /// - /// Gets an value with the and values - /// - public Double2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 YY => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(YY)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 RR => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(RG)}"); - } - - /// - /// Gets an value with the and values - /// - public Double2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 GG => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(GG)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Double2(double x) => new Double2(x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Double2 operator +(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Double2 operator /(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Double2 operator *(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Double2 operator -(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Double/Double3.cs b/src/ComputeSharp.Core/Primitives/Double/Double3.cs deleted file mode 100644 index 627f27db..00000000 --- a/src/ComputeSharp.Core/Primitives/Double/Double3.cs +++ /dev/null @@ -1,594 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 3)] - public struct Double3 - { - /// - /// Gets an value with all components set to 0 - /// - public static Double3 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Double3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double3 UnitX => new Double3(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double3 UnitY => new Double3(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double3 UnitZ => new Double3(0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - public Double3(double x, double y, double z) - { - X = x; - Y = y; - Z = z; - } - - /// - /// Gets or sets the value of the first vector component - /// - public double X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public double Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public double Z { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public double R - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public double G - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public double B - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(B)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public double this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 XX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 YY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 ZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 RR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 GG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 BB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BB)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 XXX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 XXY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 XXZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 XYX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 XYY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 XZX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 XZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 YXX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 YXY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 YYX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 YYY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 YYZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 YZY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 YZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 ZXX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 ZXZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 ZYY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 ZYZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 ZZX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 ZZY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 ZZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 RRR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 RRG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 RRB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 RGR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 RGG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 RBR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 RBB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBB)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 GRR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 GRG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 GGR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 GGG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 GGB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 GBG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 GBB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBB)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 BRR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 BRB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double2 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double2 BGG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 BGB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGB)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 BBR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Double2 BBG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 BBB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BBB)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Double3(double x) => new Double3(x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Double3 operator +(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Double3 operator /(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Double3 operator *(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Double3 operator -(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Double/Double4.cs b/src/ComputeSharp.Core/Primitives/Double/Double4.cs deleted file mode 100644 index 3bec6557..00000000 --- a/src/ComputeSharp.Core/Primitives/Double/Double4.cs +++ /dev/null @@ -1,3999 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(double) * 4)] - public struct Double4 - { - /// - /// Gets an value with all components set to 0 - /// - public static Double4 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Double4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double4 UnitX => new Double4(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double4 UnitY => new Double4(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double4 UnitZ => new Double4(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Double4 UnitW => new Double4(0, 0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - /// The value to assign to the fourth vector component - public Double4(double x, double y, double z, double w) - { - X = x; - Y = y; - Z = z; - W = w; - } - - /// - /// Gets or sets the value of the first vector component - /// - public double X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public double Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public double Z { get; set; } - - /// - /// Gets or sets the value of the fourth vector component - /// - public double W { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public double R - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public double G - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public double B - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(B)}"); - } - - /// - /// Gets or sets the value of the fourth color component - /// - public double A - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(A)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(A)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public double this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 XX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 XW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 YY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 YW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 ZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZ)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 ZW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 WX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 WY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 WZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZ)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 WW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WW)}"); - - /// - /// Gets an value with the value for all components - /// - public Double2 RR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 RA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 GG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 GA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 BB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BB)}"); - - /// - /// Gets or sets an value with the and values - /// - public Double2 BA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 AR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 AG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Double2 AB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AB)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Double2 AA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AA)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 XXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 XXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 XXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 XXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXW)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 XYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 XYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 XYW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 XZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 XZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 XZW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 XWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 XWY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 XWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 XWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWW)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 YXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 YXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 YXW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 YYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 YYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 YYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 YYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 YZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 YZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 YZW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 YWX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 YWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 YWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 YWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWW)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 ZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 ZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 ZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 ZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 ZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 ZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWW)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 WXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 WXY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 WXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 WXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 WYX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 WYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 WYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 WYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 WZX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 WZY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 WZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 WZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZW)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 WWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWX)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 WWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWY)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 WWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 WWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 RRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 RRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 RRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 RRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRA)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 RGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 RGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 RGA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 RBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 RBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 RBA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 RAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 RAG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 RAB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 RAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAA)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 GRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 GRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 GRA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 GGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 GGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 GGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGB)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 GGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 GBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 GBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 GBA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 GAR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 GAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 GAB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 GAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAA)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 BRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 BRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 BRA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 BGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 BGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 BGA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 BBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 BBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 BBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBB)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 BBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 BAR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 BAG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 BAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAB)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 BAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAA)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 ARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ARG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ARB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 ARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 AGR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 AGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 AGB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 AGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ABR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Double3 ABG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Double3 ABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABB)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 ABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABA)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 AAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAR)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 AAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAG)}"); - - /// - /// Gets an value with the , and values - /// - public Double3 AAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Double3 AAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAA)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 XXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XXYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XXZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XXWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XYZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XYZW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 XYWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XYWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 XYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 XZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XWYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 XWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 XWZY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWZ)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 XWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YXZW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 YXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YXWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YXWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 YXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YYXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 YYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWX)}"); - - /// - /// Gets an value with the , and values - /// - public Double4 YYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 YZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 YZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YWXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 YWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 YWZX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 YWZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 YWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZXYW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZXWY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZYXW - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZYWX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZWXY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZWYX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WXYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 WXYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WXZY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WYXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 WYXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYX)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 WYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WYZX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 WYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WYWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 WZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 WWZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 WWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 RRRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RRGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RRBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RRAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RRAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RRAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RGBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RGBA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 RGAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RGAB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 RGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RBGA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 RBBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RBAG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 RBAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RBAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RAGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RAGB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 RAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 RABG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 RABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 RAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAB)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 RAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GRBA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 GRAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GRAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GRAB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 GRAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GGRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 GGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAR)}"); - - /// - /// Gets an value with the , and values - /// - public Double4 GGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GGAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GBRA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 GBGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 GBBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GBAR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 GBAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GBAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GARB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 GARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 GABR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 GABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 GAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BRGA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 BRBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BRAG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 BRAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BRAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BGRA - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 BGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BGAR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 BGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 BBBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BBAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BBAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BARG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 BARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BAGR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 BAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BAGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 BABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 BAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ARGB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ARGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ARBG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ARBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ARAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ARAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 AGRB - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 AGRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGR)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 AGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 AGBR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 AGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 AGAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ABRG - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ABRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ABGR - { - get => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Double4 ABGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Double4 ABBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 ABAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 ABAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 AARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AAGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AAGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Double4 AABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Double4 AAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Double4 AAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAA)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Double4(double x) => new Double4(x, x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Double4 operator +(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Double4 operator /(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Double4 operator *(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Double4 operator -(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Float/Float2.cs b/src/ComputeSharp.Core/Primitives/Float/Float2.cs deleted file mode 100644 index 0b9e1167..00000000 --- a/src/ComputeSharp.Core/Primitives/Float/Float2.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 2)] - public struct Float2 - { - /// - /// Gets an value with all components set to 0 - /// - public static Float2 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Float2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float2 UnitX => new Float2(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float2 UnitY => new Float2(0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - public Float2(float x, float y) - { - X = x; - Y = y; - } - - /// - /// Gets or sets the value of the first vector component - /// - public float X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public float Y { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public float R - { - get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public float G - { - get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(G)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public float this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Float2)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Float2)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 XX => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(XY)}"); - } - - /// - /// Gets an value with the and values - /// - public Float2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 YY => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(YY)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 RR => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(RG)}"); - } - - /// - /// Gets an value with the and values - /// - public Float2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 GG => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(GG)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Float2(float x) => new Float2(x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Float2 operator +(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Float2 operator /(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Float2 operator *(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Float2 operator -(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Float/Float3.cs b/src/ComputeSharp.Core/Primitives/Float/Float3.cs deleted file mode 100644 index 00d1323b..00000000 --- a/src/ComputeSharp.Core/Primitives/Float/Float3.cs +++ /dev/null @@ -1,594 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 3)] - public struct Float3 - { - /// - /// Gets an value with all components set to 0 - /// - public static Float3 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Float3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float3 UnitX => new Float3(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float3 UnitY => new Float3(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float3 UnitZ => new Float3(0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - public Float3(float x, float y, float z) - { - X = x; - Y = y; - Z = z; - } - - /// - /// Gets or sets the value of the first vector component - /// - public float X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public float Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public float Z { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public float R - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public float G - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public float B - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(B)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public float this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 XX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 YY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 ZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 RR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 GG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 BB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BB)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 XXX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 XXY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 XXZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 XYX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 XYY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 XZX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 XZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 YXX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 YXY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 YYX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 YYY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 YYZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 YZY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 YZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 ZXX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 ZXZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 ZYY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 ZYZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 ZZX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 ZZY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 ZZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 RRR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 RRG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 RRB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 RGR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 RGG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 RBR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 RBB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBB)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 GRR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 GRG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 GGR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 GGG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 GGB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 GBG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 GBB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBB)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 BRR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 BRB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float2 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float2 BGG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 BGB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGB)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 BBR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Float2 BBG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 BBB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BBB)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Float3(float x) => new Float3(x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Float3 operator +(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Float3 operator /(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Float3 operator *(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Float3 operator -(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Float/Float4.cs b/src/ComputeSharp.Core/Primitives/Float/Float4.cs deleted file mode 100644 index 70f2c4b2..00000000 --- a/src/ComputeSharp.Core/Primitives/Float/Float4.cs +++ /dev/null @@ -1,3999 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(float) * 4)] - public struct Float4 - { - /// - /// Gets an value with all components set to 0 - /// - public static Float4 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Float4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float4 UnitX => new Float4(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float4 UnitY => new Float4(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float4 UnitZ => new Float4(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Float4 UnitW => new Float4(0, 0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - /// The value to assign to the fourth vector component - public Float4(float x, float y, float z, float w) - { - X = x; - Y = y; - Z = z; - W = w; - } - - /// - /// Gets or sets the value of the first vector component - /// - public float X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public float Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public float Z { get; set; } - - /// - /// Gets or sets the value of the fourth vector component - /// - public float W { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public float R - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public float G - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public float B - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(B)}"); - } - - /// - /// Gets or sets the value of the fourth color component - /// - public float A - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(A)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(A)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public float this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 XX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 XW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 YY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 YW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 ZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZ)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 ZW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 WX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 WY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 WZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZ)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 WW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WW)}"); - - /// - /// Gets an value with the value for all components - /// - public Float2 RR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 RA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 GG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 GA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 BB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BB)}"); - - /// - /// Gets or sets an value with the and values - /// - public Float2 BA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 AR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 AG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Float2 AB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AB)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Float2 AA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AA)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 XXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 XXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 XXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 XXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXW)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 XYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 XYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 XYW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 XZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 XZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 XZW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 XWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 XWY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 XWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 XWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWW)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 YXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 YXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 YXW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 YYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 YYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 YYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 YYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 YZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 YZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 YZW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 YWX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 YWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 YWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 YWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWW)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 ZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 ZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 ZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 ZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 ZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 ZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWW)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 WXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 WXY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 WXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 WXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 WYX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 WYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 WYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 WYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 WZX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 WZY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 WZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 WZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZW)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 WWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWX)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 WWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWY)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 WWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 WWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 RRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 RRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 RRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 RRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRA)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 RGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 RGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 RGA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 RBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 RBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 RBA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 RAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 RAG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 RAB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 RAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAA)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 GRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 GRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 GRA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 GGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 GGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 GGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGB)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 GGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 GBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 GBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 GBA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 GAR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 GAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 GAB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 GAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAA)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 BRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 BRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 BRA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 BGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 BGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 BGA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 BBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 BBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 BBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBB)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 BBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 BAR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 BAG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 BAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAB)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 BAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAA)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 ARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ARG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ARB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 ARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 AGR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 AGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 AGB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 AGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ABR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Float3 ABG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Float3 ABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABB)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 ABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABA)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 AAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAR)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 AAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAG)}"); - - /// - /// Gets an value with the , and values - /// - public Float3 AAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Float3 AAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAA)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 XXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XXYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XXZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XXWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XYZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XYZW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 XYWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XYWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 XYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 XZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XWYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 XWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 XWZY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWZ)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 XWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YXZW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 YXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YXWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YXWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 YXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YYXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 YYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWX)}"); - - /// - /// Gets an value with the , and values - /// - public Float4 YYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 YZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 YZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YWXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 YWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 YWZX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 YWZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 YWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZXYW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZXWY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZYXW - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZYWX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZWXY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZWYX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WXYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 WXYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WXZY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WYXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 WYXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYX)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 WYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WYZX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 WYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WYWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 WZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 WWZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 WWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 RRRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RRGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RRBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RRAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RRAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RRAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RGBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RGBA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 RGAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RGAB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 RGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RBGA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 RBBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RBAG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 RBAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RBAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RAGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RAGB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 RAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 RABG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 RABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 RAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAB)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 RAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GRBA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 GRAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GRAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GRAB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 GRAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GGRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 GGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAR)}"); - - /// - /// Gets an value with the , and values - /// - public Float4 GGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GGAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GBRA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 GBGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 GBBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GBAR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 GBAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GBAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GARB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 GARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 GABR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 GABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 GAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BRGA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 BRBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BRAG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 BRAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BRAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BGRA - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 BGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BGAR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 BGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 BBBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BBAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BBAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BARG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 BARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BAGR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 BAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BAGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 BABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 BAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ARGB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ARGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ARBG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ARBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ARAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ARAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 AGRB - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 AGRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGR)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 AGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 AGBR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 AGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 AGAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ABRG - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ABRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ABGR - { - get => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Float4 ABGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Float4 ABBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 ABAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 ABAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 AARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AAGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AAGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Float4 AABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Float4 AAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Float4 AAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAA)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Float4(float x) => new Float4(x, x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Float4 operator +(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Float4 operator /(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Float4 operator *(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Float4 operator -(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Int/Int2.cs b/src/ComputeSharp.Core/Primitives/Int/Int2.cs deleted file mode 100644 index 012170f5..00000000 --- a/src/ComputeSharp.Core/Primitives/Int/Int2.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 2)] - public struct Int2 - { - /// - /// Gets an value with all components set to 0 - /// - public static Int2 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Int2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int2 UnitX => new Int2(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int2 UnitY => new Int2(0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - public Int2(int x, int y) - { - X = x; - Y = y; - } - - /// - /// Gets or sets the value of the first vector component - /// - public int X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public int Y { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public int R - { - get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public int G - { - get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(G)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public int this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Int2)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Int2)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 XX => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(XY)}"); - } - - /// - /// Gets an value with the and values - /// - public Int2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 YY => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(YY)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 RR => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(RG)}"); - } - - /// - /// Gets an value with the and values - /// - public Int2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 GG => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(GG)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Int2(int x) => new Int2(x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Int2 operator +(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Int2 operator /(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Int2 operator *(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Int2 operator -(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Int/Int3.cs b/src/ComputeSharp.Core/Primitives/Int/Int3.cs deleted file mode 100644 index 9052701c..00000000 --- a/src/ComputeSharp.Core/Primitives/Int/Int3.cs +++ /dev/null @@ -1,594 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 3)] - public struct Int3 - { - /// - /// Gets an value with all components set to 0 - /// - public static Int3 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Int3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int3 UnitX => new Int3(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int3 UnitY => new Int3(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int3 UnitZ => new Int3(0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - public Int3(int x, int y, int z) - { - X = x; - Y = y; - Z = z; - } - - /// - /// Gets or sets the value of the first vector component - /// - public int X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public int Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public int Z { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public int R - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public int G - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public int B - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(B)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public int this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 XX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 YY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 RR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 GG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 BB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BB)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 XXX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 XXY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 XXZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 XYX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 XYY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 XZX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 XZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 YXX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 YXY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 YYX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 YYY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 YYZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 YZY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 YZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 ZXX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 ZXZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 ZYY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 ZYZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 ZZX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 ZZY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 ZZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 RRR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 RRG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 RRB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 RGR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 RGG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 RBR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 RBB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBB)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 GRR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 GRG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 GGR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 GGG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 GGB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 GBG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 GBB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBB)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 BRR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 BRB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int2 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int2 BGG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 BGB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGB)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 BBR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Int2 BBG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 BBB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BBB)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Int3(int x) => new Int3(x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Int3 operator +(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Int3 operator /(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Int3 operator *(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Int3 operator -(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/Int/Int4.cs b/src/ComputeSharp.Core/Primitives/Int/Int4.cs deleted file mode 100644 index ae191475..00000000 --- a/src/ComputeSharp.Core/Primitives/Int/Int4.cs +++ /dev/null @@ -1,3999 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(int) * 4)] - public struct Int4 - { - /// - /// Gets an value with all components set to 0 - /// - public static Int4 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static Int4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int4 UnitX => new Int4(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int4 UnitY => new Int4(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int4 UnitZ => new Int4(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static Int4 UnitW => new Int4(0, 0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - /// The value to assign to the fourth vector component - public Int4(int x, int y, int z, int w) - { - X = x; - Y = y; - Z = z; - W = w; - } - - /// - /// Gets or sets the value of the first vector component - /// - public int X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public int Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public int Z { get; set; } - - /// - /// Gets or sets the value of the fourth vector component - /// - public int W { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public int R - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public int G - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public int B - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(B)}"); - } - - /// - /// Gets or sets the value of the fourth color component - /// - public int A - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(A)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(A)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public int this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 XX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 XW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 YY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 YW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZ)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 ZW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 WX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 WY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 WZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZ)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 WW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WW)}"); - - /// - /// Gets an value with the value for all components - /// - public Int2 RR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 RA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 GG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 GA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 BB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BB)}"); - - /// - /// Gets or sets an value with the and values - /// - public Int2 BA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 AR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 AG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public Int2 AB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AB)}"); - } - - /// - /// Gets an value with the value for all components - /// - public Int2 AA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AA)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 XXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 XXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 XXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 XXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXW)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 XYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 XYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 XYW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 XZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 XZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 XZW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 XWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 XWY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 XWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 XWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWW)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 YXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 YXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 YXW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 YYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 YYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 YYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 YYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 YZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 YZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 YZW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 YWX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 YWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 YWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 YWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWW)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 ZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 ZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 ZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 ZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 ZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 ZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWW)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 WXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 WXY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 WXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 WXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 WYX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 WYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 WYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 WYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 WZX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 WZY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 WZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZ)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 WZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZW)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 WWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWX)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 WWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWY)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 WWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 WWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 RRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 RRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 RRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 RRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRA)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 RGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 RGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 RGA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 RBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 RBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 RBA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 RAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 RAG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 RAB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 RAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAA)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 GRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 GRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 GRA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 GGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 GGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 GGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGB)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 GGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 GBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 GBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 GBA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 GAR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 GAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 GAB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 GAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAA)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 BRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 BRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 BRA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 BGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 BGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 BGA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 BBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 BBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 BBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBB)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 BBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 BAR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 BAG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 BAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAB)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 BAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAA)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 ARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ARG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ARB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 ARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 AGR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 AGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 AGB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 AGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ABR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public Int3 ABG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABG)}"); - } - - /// - /// Gets an value with the , and values - /// - public Int3 ABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABB)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 ABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABA)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 AAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAR)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 AAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAG)}"); - - /// - /// Gets an value with the , and values - /// - public Int3 AAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Int3 AAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAA)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 XXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XXYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XXZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XXWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XYZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XYZW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 XYWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XYWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 XYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XZYW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 XZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XZWY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XWYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 XWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 XWZY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWZ)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 XWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YXZW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 YXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YXWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YXWZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 YXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YYXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYX)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 YYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWX)}"); - - /// - /// Gets an value with the , and values - /// - public Int4 YYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YZXW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 YZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YZWX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 YZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YWXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 YWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 YWZX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 YWZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 YWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZXYW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZXWY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZYXW - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZYWX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZWXY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZWYX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WXYZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 WXYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WXZY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WYXZ - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 WYXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYX)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 WYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WYZX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 WYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WYWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WZXY - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WZYX - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 WZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 WWZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 WWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWW)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 RRRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RRGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RRBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RRAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RRAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RRAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RGBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RGBA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 RGAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RGAB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 RGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RBGA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 RBBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RBAG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 RBAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RBAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RAGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RAGB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 RAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 RABG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 RABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 RAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAB)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 RAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GRBA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 GRAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GRAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GRAB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 GRAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GGRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGR)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 GGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAR)}"); - - /// - /// Gets an value with the , and values - /// - public Int4 GGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GGAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GBRA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 GBGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 GBBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GBAR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 GBAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GBAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GARB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 GARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 GABR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 GABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 GAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BRGA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 BRBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BRAG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 BRAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BRAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BGRA - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 BGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BGAR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 BGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBG)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 BBBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BBAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BBAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BARG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 BARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BAGR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 BAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BAGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 BABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 BAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ARGB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ARGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ARBG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ARBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ARAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ARAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 AGRB - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 AGRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGR)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 AGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 AGBR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 AGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 AGAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ABRG - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ABRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ABGR - { - get => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public Int4 ABGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public Int4 ABBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 ABAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 ABAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 AARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AAGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AAGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public Int4 AABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABB)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABA)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public Int4 AAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAB)}"); - - /// - /// Gets an value with the value for all components - /// - public Int4 AAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAA)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator Int4(int x) => new Int4(x, x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static Int4 operator +(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static Int4 operator /(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static Int4 operator *(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static Int4 operator -(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/ThreadIds.cs b/src/ComputeSharp.Core/Primitives/ThreadIds.cs deleted file mode 100644 index 7b4944a6..00000000 --- a/src/ComputeSharp.Core/Primitives/ThreadIds.cs +++ /dev/null @@ -1,25 +0,0 @@ -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that indicates the ids of a given GPU thread running a compute shader - /// - public readonly struct ThreadIds - { - /// - /// Gets the X id of the current thread - /// - public int X => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(X)}"); - - /// - /// Gets the Y id of the current thread - /// - public int Y => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(Y)}"); - - /// - /// Gets the Z id of the current thread - /// - public int Z => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(Z)}"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs deleted file mode 100644 index df1ced13..00000000 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt2.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 2)] - public struct UInt2 - { - /// - /// Gets an value with all components set to 0 - /// - public static UInt2 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static UInt2 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt2 UnitX => new UInt2(1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt2 UnitY => new UInt2(0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - public UInt2(uint x, uint y) - { - X = x; - Y = y; - } - - /// - /// Gets or sets the value of the first vector component - /// - public uint X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public uint Y { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public uint R - { - get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public uint G - { - get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(G)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public float this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(UInt2)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(UInt2)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 XX => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(XY)}"); - } - - /// - /// Gets an value with the and values - /// - public UInt2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 YY => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(YY)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 RR => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(RG)}"); - } - - /// - /// Gets an value with the and values - /// - public UInt2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 GG => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(GG)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator UInt2(uint x) => new UInt2(x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static UInt2 operator +(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static UInt2 operator /(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static UInt2 operator *(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static UInt2 operator -(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs deleted file mode 100644 index b5eee9b7..00000000 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt3.cs +++ /dev/null @@ -1,594 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 3)] - public struct UInt3 - { - /// - /// Gets an value with all components set to 0 - /// - public static UInt3 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static UInt3 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt3 UnitX => new UInt3(1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt3 UnitY => new UInt3(0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt3 UnitZ => new UInt3(0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - public UInt3(uint x, uint y, uint z) - { - X = x; - Y = y; - Z = z; - } - - /// - /// Gets or sets the value of the first vector component - /// - public uint X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public uint Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public uint Z { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public uint R - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public uint G - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public uint B - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(B)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public uint this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}[int]"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}[int]"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 XX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 YY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 ZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 RR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 GG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 BB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BB)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 XXX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 XXY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 XXZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 XYX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 XYY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 XZX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 XZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 YXX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 YXY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 YYX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 YYY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 YYZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 YZY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 YZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 ZXX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 ZXZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 ZYY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 ZYZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 ZZX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 ZZY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 ZZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 RRR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 RRG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 RRB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 RGR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 RGG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 RBR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 RBB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 GRR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 GRG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRB)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 GGR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 GGG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 GGB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 GBG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 GBB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 BRR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 BRB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt2 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt2 BGG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 BGB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 BBR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt2 BBG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 BBB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BBB)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator UInt3(uint x) => new UInt3(x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static UInt3 operator +(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static UInt3 operator /(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static UInt3 operator *(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static UInt3 operator -(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs b/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs deleted file mode 100644 index aeb1c202..00000000 --- a/src/ComputeSharp.Core/Primitives/UInt/UInt4.cs +++ /dev/null @@ -1,3999 +0,0 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; - -namespace ComputeSharp -{ - /// - /// A that maps the HLSL type - /// - [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] - [StructLayout(LayoutKind.Sequential, Size = sizeof(uint) * 4)] - public struct UInt4 - { - /// - /// Gets an value with all components set to 0 - /// - public static UInt4 Zero => 0; - - /// - /// Gets an value with all components set to 1 - /// - public static UInt4 One => 1; - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt4 UnitX => new UInt4(1, 0, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt4 UnitY => new UInt4(0, 1, 0, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt4 UnitZ => new UInt4(0, 0, 1, 0); - - /// - /// Gets an value with the component set to 1, and the others to 0 - /// - public static UInt4 UnitW => new UInt4(0, 0, 0, 1); - - /// - /// Creates a new instance with the specified parameters - /// - /// The value to assign to the first vector component - /// The value to assign to the second vector component - /// The value to assign to the third vector component - /// The value to assign to the fourth vector component - public UInt4(uint x, uint y, uint z, uint w) - { - X = x; - Y = y; - Z = z; - W = w; - } - - /// - /// Gets or sets the value of the first vector component - /// - public uint X { get; set; } - - /// - /// Gets or sets the value of the second vector component - /// - public uint Y { get; set; } - - /// - /// Gets or sets the value of the third vector component - /// - public uint Z { get; set; } - - /// - /// Gets or sets the value of the fourth vector component - /// - public uint W { get; set; } - - /// - /// Gets or sets the value of the first color component - /// - public uint R - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(R)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(R)}"); - } - - /// - /// Gets or sets the value of the second color component - /// - public uint G - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(G)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(G)}"); - } - - /// - /// Gets or sets the value of the third color component - /// - public uint B - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(B)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(B)}"); - } - - /// - /// Gets or sets the value of the fourth color component - /// - public uint A - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(A)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(A)}"); - } - - /// - /// Gets or sets a specific component in the current instance - /// - /// The index of the component to access - public uint this[int i] - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}[uint]"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}[uint]"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 XX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XX)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 XY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 XZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 XW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 YX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YX)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 YY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YY)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 YZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZ)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 YW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 ZX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 ZY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZY)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 ZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZ)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 ZW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZW)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 WX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WX)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 WY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WY)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 WZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZ)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 WW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WW)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt2 RR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RR)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 RG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 RB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 RA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 GR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GR)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 GG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GG)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 GB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GB)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 GA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 BR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 BG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BG)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 BB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BB)}"); - - /// - /// Gets or sets an value with the and values - /// - public UInt2 BA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BA)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 AR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AR)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 AG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AG)}"); - } - - /// - /// Gets or sets an value with the and values - /// - public UInt2 AB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AB)}"); - } - - /// - /// Gets an value with the value for all components - /// - public UInt2 AA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AA)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 XXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 XXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 XXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 XXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXW)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 XYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 XYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 XYZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 XYW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 XZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 XZY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 XZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 XZW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZW)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 XWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 XWY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 XWZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 XWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWW)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 YXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 YXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 YXZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZ)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 YXW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXW)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 YYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYX)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 YYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 YYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 YYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 YZX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZX)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 YZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 YZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 YZW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 YWX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWX)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 YWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 YWZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 YWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWW)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 ZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ZXY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXY)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 ZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ZXW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXW)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ZYX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 ZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 ZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZ)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ZYW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYW)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 ZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 ZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 ZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 ZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ZWX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ZWY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWY)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 ZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 ZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWW)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 WXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXX)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 WXY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXY)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 WXZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 WXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 WYX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYX)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 WYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYY)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 WYZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZ)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 WYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYW)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 WZX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZX)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 WZY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZY)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 WZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZ)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 WZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZW)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 WWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 WWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWY)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 WWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 WWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWW)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 RRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 RRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 RRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 RRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRA)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 RGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 RGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 RGB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 RGA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 RBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 RBG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBG)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 RBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 RBA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBA)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 RAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 RAG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 RAB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 RAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAA)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 GRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 GRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 GRB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRB)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 GRA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRA)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 GGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGR)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 GGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 GGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 GGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 GBR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBR)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 GBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 GBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 GBA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 GAR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAR)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 GAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 GAB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAB)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 GAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAA)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 BRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 BRG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRG)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 BRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 BRA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRA)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 BGR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 BGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 BGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGB)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 BGA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGA)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 BBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 BBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBG)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 BBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 BBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 BAR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 BAG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAG)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 BAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 BAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAA)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 ARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARR)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ARG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARG)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ARB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARB)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 ARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 AGR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGR)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 AGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGG)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 AGB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGB)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 AGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGA)}"); - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ABR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABR)}"); - } - - /// - /// Gets or sets an value with the , and values - /// - public UInt3 ABG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABG)}"); - } - - /// - /// Gets an value with the , and values - /// - public UInt3 ABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABB)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 ABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABA)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 AAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 AAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAG)}"); - - /// - /// Gets an value with the , and values - /// - public UInt3 AAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAB)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt3 AAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAA)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 XXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XXYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XXZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XXWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XXWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XYZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XYZW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XYWZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 XYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XZYW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XZWY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XWYZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 XWZY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 XWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWZ)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 XWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YXZW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YXWZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 YXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YYXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYX)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 YYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWX)}"); - - /// - /// Gets an value with the , and values - /// - public UInt4 YYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YYWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YZXW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 YZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YZWX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YWXZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 YWZX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 YWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZXYW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZXWY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXZ)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZYXW - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXW)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXW)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZYWX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZY)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZWXY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZWYX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ZWZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ZWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WXYZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WXZY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WXWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WYXZ - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXZ)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXZ)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYX)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 WYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WYZX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WYWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WZXY - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXY)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXY)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXW)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WZYX - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYX)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYX)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZY)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 WZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXY)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WWXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZX)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 WWZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZZ)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZW)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWX)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWY)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 WWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWZ)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 WWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWW)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 RRRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RRGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RRBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RRAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RRAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RRAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RGBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RGBA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RGAB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 RGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RBGA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RBAG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RBAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RAGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RAGB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 RAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 RABG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 RABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 RAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAB)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 RAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GRBA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GRAB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 GRAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GGRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGR)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 GGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAR)}"); - - /// - /// Gets an value with the , and values - /// - public UInt4 GGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GGAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GBRA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 GBBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GBAR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GBAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GARB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 GARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 GABR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 GABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 GAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BRGA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BRAG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BRAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRB)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BGRA - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRA)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRA)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BGAR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBG)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 BBBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BBAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BBAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BARG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 BARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BAGR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 BAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BAGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 BABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 BAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ARGB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ARBG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ARAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ARAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 AGRB - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRB)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRB)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGR)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 AGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 AGBR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 AGAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ABRG - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRG)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRG)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRA)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ABGR - { - get => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGR)}"); - set => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGR)}"); - } - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBG)}"); - - /// - /// Gets an value with the , value for all components - /// - public UInt4 ABBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 ABAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 ABAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARG)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 AARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AAGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AAGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABR)}"); - - /// - /// Gets or sets an value with the , , and values - /// - public UInt4 AABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABB)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABA)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAR)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAG)}"); - - /// - /// Gets an value with the , , and values - /// - public UInt4 AAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAB)}"); - - /// - /// Gets an value with the value for all components - /// - public UInt4 AAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAA)}"); - - /// - /// Creates a new value with the same value for all its components - /// - /// The value to use for the components of the new instance - public static implicit operator UInt4(uint x) => new UInt4(x, x, x, x); - - /// - /// Sums two values - /// - /// The first value to sum - /// The second value to sum - public static UInt4 operator +(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.+"); - - /// - /// Divides two values - /// - /// The first value to divide - /// The second value to divide - public static UInt4 operator /(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}./"); - - /// - /// Multiplies two values - /// - /// The first value to multiply - /// The second value to multiply - public static UInt4 operator *(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.*"); - - /// - /// Subtracts two values - /// - /// The first value to subtract - /// The second value to subtract - public static UInt4 operator -(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.-"); - } -} diff --git a/src/ComputeSharp.Core/Properties/AssemblyInfo.cs b/src/ComputeSharp.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index 97fd8747..00000000 --- a/src/ComputeSharp.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("ComputeSharp.Graphics")] -[assembly: InternalsVisibleTo("ComputeSharp.Shaders")] diff --git a/src/ComputeSharp.Graphics/Buffers/Abstract/GraphicsResource.cs b/src/ComputeSharp.Graphics/Buffers/Abstract/GraphicsResource.cs deleted file mode 100644 index 6e266844..00000000 --- a/src/ComputeSharp.Graphics/Buffers/Abstract/GraphicsResource.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using Vortice.Direct3D12; - -namespace ComputeSharp.Graphics.Buffers.Abstract -{ - /// - /// An abstract that represents a graphics resource object - /// - public abstract class GraphicsResource : IDisposable - { - /// - /// Creates a new instance with the specified parameters - /// - /// The associated with the current instance - protected GraphicsResource(GraphicsDevice device) - { - GraphicsDevice = device; - } - - /// - /// Gets the associated with the current instance - /// - public GraphicsDevice GraphicsDevice { get; } - - /// - /// Gets the object currently mapped - /// - protected internal ID3D12Resource? NativeResource { get; set; } - - /// - /// Gets the instance for the current resource - /// - protected internal CpuDescriptorHandle? NativeCpuDescriptorHandle { get; protected set; } - - /// - /// Gets the instance for the current resource - /// - protected internal GpuDescriptorHandle? NativeGpuDescriptorHandle { get; protected set; } - - /// - /// Maps the current resource to a specified subresource - /// - /// A instance representing the mapped resource - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal MappedResource MapResource() - { - var resource = NativeResource ?? throw new InvalidOperationException("Missing resource"); - - return new MappedResource(resource); - } - - /// - public virtual void Dispose() => NativeResource?.Dispose(); - - /// - /// A type representing a mapped memory resource - /// - internal readonly ref struct MappedResource - { - /// - /// The target to map - /// - private readonly ID3D12Resource Resource; - - /// - /// The pointer to the mapped resource - /// - public readonly IntPtr Pointer; - - /// - /// Creates a new instance for a given value - /// - /// The input instance to map - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public MappedResource(ID3D12Resource resource) - { - Resource = resource; - Pointer = resource.Map(0); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dispose() - { - Resource.Unmap(0); - } - } - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/Abstract/HlslBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/Abstract/HlslBuffer{T}.cs deleted file mode 100644 index 4b938cca..00000000 --- a/src/ComputeSharp.Graphics/Buffers/Abstract/HlslBuffer{T}.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Buffers; -using System.Diagnostics.Contracts; -using ComputeSharp.Graphics.Buffers.Enums; - -namespace ComputeSharp.Graphics.Buffers.Abstract -{ - /// - /// A representing a typed buffer stored on GPU memory, that can be used from an HLSL shader - /// - /// The type of items stored on the buffer - public abstract class HlslBuffer : Buffer where T : unmanaged - { - /// - /// Creates a new instance with the specified parameters - /// - /// The associated with the current instance - /// The number of items to store in the current buffer - /// The size in bytes for the current buffer - /// The buffer type for the current buffer - private protected HlslBuffer(GraphicsDevice device, int size, int sizeInBytes, BufferType bufferType) : base(device, size, sizeInBytes, bufferType) { } - - /// - /// Reads the contents of the current instance and returns an array - /// - /// A array with the contents of the current buffer - [Pure] - public T[] GetData() => GetData(0, Size); - - /// - /// Reads the contents of the current instance in a given range and returns an array - /// - /// The offset to start reading data from - /// The number of items to read - /// A array with the contents of the specified range from the current buffer - [Pure] - public T[] GetData(int offset, int count) - { - T[] data = new T[count]; - GetData(data, offset, count); - - return data; - } - - /// - /// Reads the contents of the current instance and writes them into a target - /// - /// The input to write data to - public void GetData(Span span) => GetData(span, 0, Size); - - /// - /// Reads the contents of the specified range from the current instance and writes them into a target - /// - /// The input to write data to - /// The offset to start reading data from - /// The number of items to read - public abstract void GetData(Span span, int offset, int count); - - /// - /// Writes the contents of a given array to the current instance - /// - /// The input array to read data from - public void SetData(T[] array) => SetData(array.AsSpan()); - - /// - /// Writes the contents of a given array to a specified area of the current instance - /// - /// The input array to read data from - /// The offset to start writing data to - /// The number of items to write - public void SetData(T[] array, int offset, int count) => SetData(array.AsSpan(), offset, count); - - /// - /// Writes the contents of a given to the current instance - /// - /// The input to read data from - public void SetData(ReadOnlySpan span) => SetData(span, 0, Size); - - /// - /// Writes the contents of a given to a specified area of the current instance - /// - /// The input to read data from - /// The offset to start writing data to - /// The number of items to write - public abstract void SetData(ReadOnlySpan span, int offset, int count); - - /// - /// Writes the contents of a given to the current instance - /// - /// The input to read data from - public abstract void SetData(HlslBuffer buffer); - - /// - /// Writes the contents of a given to the current instance, using a temporary CPU buffer - /// - /// The input to read data from - protected void SetDataWithCpuBuffer(HlslBuffer buffer) - { - // Create a temporary array - T[] array = ArrayPool.Shared.Rent(buffer.Size); - Span span = array.AsSpan(0, buffer.Size); - - // Get the unpadded data from the read write buffer - buffer.GetData(span); - - // Set the data, adding the padding if needed - SetData(span); - - ArrayPool.Shared.Return(array); - } - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/Abstract/HlslStructuredBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/Abstract/HlslStructuredBuffer{T}.cs deleted file mode 100644 index 0ccdafc6..00000000 --- a/src/ComputeSharp.Graphics/Buffers/Abstract/HlslStructuredBuffer{T}.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.Graphics.Buffers.Enums; -using ComputeSharp.Graphics.Helpers; -using Vortice.Direct3D12; -using CommandList = ComputeSharp.Graphics.Commands.CommandList; - -namespace ComputeSharp.Graphics.Buffers.Abstract -{ - /// - /// A representing a typed structured buffer stored on GPU memory - /// - /// The type of items stored on the buffer - public abstract class HlslStructuredBuffer : HlslBuffer where T : unmanaged - { - /// - /// Creates a new instance with the specified parameters - /// - /// The associated with the current instance - /// The number of items to store in the current buffer - /// The buffer type for the current buffer - internal HlslStructuredBuffer(GraphicsDevice device, int size, BufferType bufferType) : base(device, size, size * Unsafe.SizeOf(), bufferType) { } - - /// - public override void GetData(Span span, int offset, int count) - { - using Buffer transferBuffer = new Buffer(GraphicsDevice, count, count * ElementSizeInBytes, BufferType.ReadBack); - - using (CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy)) - { - copyCommandList.CopyBufferRegion(this, offset * ElementSizeInBytes, transferBuffer, 0, count * ElementSizeInBytes); - copyCommandList.ExecuteAndWaitForCompletion(); - } - - using MappedResource resource = transferBuffer.MapResource(); - - MemoryHelper.Copy(resource.Pointer, 0, span, 0, count); - } - - /// - public override void SetData(ReadOnlySpan span, int offset, int count) - { - using Buffer transferBuffer = new Buffer(GraphicsDevice, count, count * ElementSizeInBytes, BufferType.Transfer); - - using (MappedResource resource = transferBuffer.MapResource()) - { - MemoryHelper.Copy(span, resource.Pointer, 0, count); - } - - using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy); - - copyCommandList.CopyBufferRegion(transferBuffer, 0, this, offset * ElementSizeInBytes, count * ElementSizeInBytes); - copyCommandList.ExecuteAndWaitForCompletion(); - } - - /// - public override void SetData(HlslBuffer buffer) - { - if (!buffer.IsPaddingPresent) - { - // Directly copy the input buffer - using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy); - - copyCommandList.CopyBufferRegion(buffer, 0, this, 0, SizeInBytes); - copyCommandList.ExecuteAndWaitForCompletion(); - } - else SetDataWithCpuBuffer(buffer); - } - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/Buffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/Buffer{T}.cs deleted file mode 100644 index 1d8f881c..00000000 --- a/src/ComputeSharp.Graphics/Buffers/Buffer{T}.cs +++ /dev/null @@ -1,153 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Graphics.Buffers.Enums; -using SharpGen.Runtime; -using Vortice.Direct3D12; - -namespace ComputeSharp.Graphics.Buffers -{ - /// - /// A representing a typed buffer stored on GPU memory - /// - /// The type of items stored on the buffer - public class Buffer : GraphicsResource where T : unmanaged - { - /// - /// Creates a new instance with the specified parameters - /// - /// The associated with the current instance - /// The number of items to store in the current buffer - /// The size in bytes for the current buffer - /// The buffer type for the current buffer - internal Buffer(GraphicsDevice device, int size, int sizeInBytes, BufferType bufferType) : base(device) - { - Size = size; - SizeInBytes = sizeInBytes; // Not necessarily a multiple of the element size, as there could be padding - ElementSizeInBytes = Unsafe.SizeOf(); - BufferType = bufferType; - PaddedElementSizeInBytes = sizeInBytes / size; - - // Determine the right heap type and flags - (HeapType heapType, ResourceFlags flags, ResourceStates states) = bufferType switch - { - BufferType.Constant => (HeapType.Upload, ResourceFlags.None, ResourceStates.GenericRead), - BufferType.ReadOnly => (HeapType.Default, ResourceFlags.None, ResourceStates.Common), - BufferType.ReadWrite => (HeapType.Default, ResourceFlags.AllowUnorderedAccess, ResourceStates.Common), - BufferType.ReadBack => (HeapType.Readback, ResourceFlags.None, ResourceStates.CopyDestination), - BufferType.Transfer => (HeapType.Upload, ResourceFlags.None, ResourceStates.GenericRead), - _ => throw new ArgumentException($"Invalid buffer type {bufferType}", nameof(bufferType)) - }; - - // Create the native resource - ResourceDescription description = ResourceDescription.Buffer(sizeInBytes, flags); - Result result = GraphicsDevice.NativeDevice.CreateCommittedResource(new HeapProperties(heapType), HeapFlags.None, description, states, out ID3D12Resource? resource); - - if (result.Failure) - { - throw new COMException("Failed to create the committed resource", result.Code); - } - - NativeResource = resource!; - - // Create the resource handles, if needed - (NativeCpuDescriptorHandle, NativeGpuDescriptorHandle) = bufferType switch - { - BufferType.Constant => CreateConstantBufferView(), - BufferType.ReadOnly => CreateShaderResourceView(), - BufferType.ReadWrite => CreateUnorderedAccessView(), - _ => default - }; - } - - /// - /// Gets the size of the current buffer, as in the number of values it contains - /// - public int Size { get; } - - /// - /// Gets the size in bytes of the current buffer - /// - protected int SizeInBytes { get; } - - /// - /// Gets the size in bytes of each value contained in the buffer - /// - protected int ElementSizeInBytes { get; } - - /// - /// Gets the size in bytes of the current buffer - /// - internal int PaddedElementSizeInBytes { get; } - - /// - /// Gets whether or not there is some padding between elements in the current buffer - /// - internal bool IsPaddingPresent => PaddedElementSizeInBytes > ElementSizeInBytes; - - /// - /// Gets the buffer type for the current instance - /// - internal BufferType BufferType { get; } - - /// - /// Creates the descriptors for a constant buffer - /// - /// The CPU and GPU handles for a constant buffer - [Pure] - private (CpuDescriptorHandle, GpuDescriptorHandle) CreateConstantBufferView() - { - (CpuDescriptorHandle cpuHandle, GpuDescriptorHandle gpuHandle) = GraphicsDevice.ShaderResourceViewAllocator.Allocate(); - - int constantBufferSize = (SizeInBytes + 255) & ~255; - - ConstantBufferViewDescription description = new ConstantBufferViewDescription - { - BufferLocation = NativeResource!.GPUVirtualAddress, - SizeInBytes = constantBufferSize - }; - - GraphicsDevice.NativeDevice.CreateConstantBufferView(description, cpuHandle); - - return (cpuHandle, gpuHandle); - } - - private (CpuDescriptorHandle, GpuDescriptorHandle) CreateShaderResourceView() - { - (CpuDescriptorHandle cpuHandle, GpuDescriptorHandle gpuHandle) = GraphicsDevice.ShaderResourceViewAllocator.Allocate(); - - ShaderResourceViewDescription description = new ShaderResourceViewDescription - { - Shader4ComponentMapping = 5768, - ViewDimension = ShaderResourceViewDimension.Buffer, - Buffer = { NumElements = Size, StructureByteStride = ElementSizeInBytes } - }; - - GraphicsDevice.NativeDevice.CreateShaderResourceView(NativeResource, description, cpuHandle); - - return (cpuHandle, gpuHandle); - } - - /// - /// Creates the descriptors for a read write buffer - /// - /// The CPU and GPU handles for a read write buffer - [Pure] - private (CpuDescriptorHandle, GpuDescriptorHandle) CreateUnorderedAccessView() - { - (CpuDescriptorHandle cpuHandle, GpuDescriptorHandle gpuHandle) = GraphicsDevice.ShaderResourceViewAllocator.Allocate(); - - UnorderedAccessViewDescription description = new UnorderedAccessViewDescription - { - ViewDimension = UnorderedAccessViewDimension.Buffer, - Buffer = { NumElements = Size, StructureByteStride = ElementSizeInBytes } - }; - - GraphicsDevice.NativeDevice.CreateUnorderedAccessView(NativeResource, null, description, cpuHandle); - - return (cpuHandle, gpuHandle); - } - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/ConstantBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/ConstantBuffer{T}.cs deleted file mode 100644 index 57fe2430..00000000 --- a/src/ComputeSharp.Graphics/Buffers/ConstantBuffer{T}.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; -using ComputeSharp.Graphics; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Graphics.Buffers.Enums; -using ComputeSharp.Graphics.Helpers; -using Vortice.Direct3D12; -using CommandList = ComputeSharp.Graphics.Commands.CommandList; - -namespace ComputeSharp -{ - /// - /// A representing a typed read write buffer stored on GPU memory - /// - /// The type of items stored on the buffer - public sealed class ConstantBuffer : HlslBuffer where T : unmanaged - { - /// - /// Creates a new instance with the specified parameters - /// - /// The associated with the current instance - /// The number of items to store in the current buffer - internal ConstantBuffer(GraphicsDevice device, int size) : base(device, size, size * GetPaddedSize(), BufferType.Constant) { } - - /// - /// Gets the right padded size for elements to store in the current instance - /// - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int GetPaddedSize() - { - int size = Unsafe.SizeOf(); - - return (size + 15) & ~15; - } - - /// - /// Gets a single value from the current constant buffer - /// - /// The index of the value to get - /// This API can only be used from a compute shader, and will always throw if used anywhere else - public T this[int i] => throw new InvalidExecutionContextException($"{nameof(ConstantBuffer)}[int]"); - - /// - public override unsafe void GetData(Span span, int offset, int count) - { - using MappedResource resource = MapResource(); - - if (IsPaddingPresent) - { - ref T spanRef = ref MemoryMarshal.GetReference(span); - ref byte resourceRef = ref Unsafe.AsRef((void*)resource.Pointer); - - // Move to the initial ref - resourceRef = ref Unsafe.Add(ref resourceRef, offset * GetPaddedSize()); - - for (var i = 0; i < count; i++) - { - ref byte targetRef = ref Unsafe.Add(ref resourceRef, i * GetPaddedSize()); - - Unsafe.Add(ref spanRef, i) = Unsafe.As(ref targetRef); - } - } - else MemoryHelper.Copy(resource.Pointer, offset, span, 0, count); - } - - /// - public override unsafe void SetData(ReadOnlySpan span, int offset, int count) - { - using MappedResource resource = MapResource(); - - if (IsPaddingPresent) - { - ref T spanRef = ref MemoryMarshal.GetReference(span); - ref byte resourceRef = ref Unsafe.AsRef((void*)resource.Pointer); - - // Move to the initial offset - resourceRef = ref Unsafe.Add(ref resourceRef, offset * GetPaddedSize()); - - for (var i = 0; i < count; i++) - { - ref byte targetRef = ref Unsafe.Add(ref resourceRef, i * GetPaddedSize()); - - Unsafe.As(ref targetRef) = Unsafe.Add(ref spanRef, i); - } - } - else MemoryHelper.Copy(span, resource.Pointer, offset, count); - } - - /// - public override void SetData(HlslBuffer buffer) - { - if (buffer is ConstantBuffer) - { - // Directly copy the input buffer, if possible - using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy); - - copyCommandList.CopyBufferRegion(buffer, 0, this, 0, SizeInBytes); - copyCommandList.ExecuteAndWaitForCompletion(); - } - else SetDataWithCpuBuffer(buffer); - } - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/Enums/BufferType.cs b/src/ComputeSharp.Graphics/Buffers/Enums/BufferType.cs deleted file mode 100644 index 8c7bbd63..00000000 --- a/src/ComputeSharp.Graphics/Buffers/Enums/BufferType.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace ComputeSharp.Graphics.Buffers.Enums -{ - /// - /// An that indicates the type of a given HLSL buffer - /// - internal enum BufferType - { - /// - /// A constant buffer, with items aligned to 16 bytes, used for individual values or very small arrays, mapped to - /// - Constant, - - /// - /// A readonly buffer, that can store arbitrary arrays of values, mapped to - /// - ReadOnly, - - /// - /// A read write buffer, that can store arbitrary arrays with both read and write access, mapped to - /// - ReadWrite, - - /// - /// A readback buffer, used as temporary buffer to read data back from buffers in the default heap, mapped to - /// - ReadBack, - - /// - /// A transfer buffer, used as a temporary buffer to set data to buffers in the default heap, mapped to - /// - Transfer - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/Extensions/BufferExtensions.cs b/src/ComputeSharp.Graphics/Buffers/Extensions/BufferExtensions.cs deleted file mode 100644 index e2ab354b..00000000 --- a/src/ComputeSharp.Graphics/Buffers/Extensions/BufferExtensions.cs +++ /dev/null @@ -1,229 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; -using ComputeSharp.Graphics; -using ComputeSharp.Graphics.Buffers.Abstract; -using Microsoft.Toolkit.HighPerformance.Extensions; - -namespace ComputeSharp -{ - /// - /// A with extension methods for the type to allocate buffers - /// - public static class BufferExtensions - { - /// - /// Allocates a new constant buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input array with the data to copy on the allocated buffer - /// A constant instance with the contents of the input array - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[] array) where T : unmanaged - { - return device.AllocateConstantBuffer(array.AsSpan()); - } - - /// - /// Allocates a new constant buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input 2D array with the data to copy on the allocated buffer - /// A constant instance with the contents of the input 2D array - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged - { - return device.AllocateConstantBuffer(array.AsSpan()); - } - - /// - /// Allocates a new constant buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input with the data to copy on the allocated buffer - /// A constant instance with the contents of the input - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, Span span) where T : unmanaged - { - ConstantBuffer buffer = new ConstantBuffer(device, span.Length); - buffer.SetData(span); - - return buffer; - } - - /// - /// Allocates a new constant buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input with the data to copy on the allocated buffer - /// A constant instance with the contents of the input - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, HlslBuffer buffer) where T : unmanaged - { - ConstantBuffer constantBuffer = new ConstantBuffer(device, buffer.Size); - constantBuffer.SetData(buffer); - - return constantBuffer; - } - - /// - /// Allocates a new readonly buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The size of the buffer to allocate - /// A zeroed instance of size - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, int size) where T : unmanaged - { - return new ReadOnlyBuffer(device, size); - } - - /// - /// Allocates a new readonly buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input array with the data to copy on the allocated buffer - /// A read write instance with the contents of the input array - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[] array) where T : unmanaged - { - return device.AllocateReadOnlyBuffer(array.AsSpan()); - } - - /// - /// Allocates a new readonly buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input 2D array with the data to copy on the allocated buffer - /// A read write instance with the contents of the input 2D array - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged - { - return device.AllocateReadOnlyBuffer(array.AsSpan()); - } - - /// - /// Allocates a new readonly buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input with the data to copy on the allocated buffer - /// A read write instance with the contents of the input - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, Span span) where T : unmanaged - { - ReadOnlyBuffer buffer = new ReadOnlyBuffer(device, span.Length); - buffer.SetData(span); - - return buffer; - } - - /// - /// Allocates a new readonly buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input with the data to copy on the allocated buffer - /// A read write instance with the contents of the input - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, HlslBuffer buffer) where T : unmanaged - { - ReadOnlyBuffer readWriteBuffer = new ReadOnlyBuffer(device, buffer.Size); - readWriteBuffer.SetData(buffer); - - return readWriteBuffer; - } - - /// - /// Allocates a new read write buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The size of the buffer to allocate - /// A zeroed instance of size - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, int size) where T : unmanaged - { - return new ReadWriteBuffer(device, size); - } - - /// - /// Allocates a new read write buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input array with the data to copy on the allocated buffer - /// A read write instance with the contents of the input array - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[] array) where T : unmanaged - { - return device.AllocateReadWriteBuffer(array.AsSpan()); - } - - /// - /// Allocates a new read write buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input 2D array with the data to copy on the allocated buffer - /// A read write instance with the contents of the input 2D array - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[,] array) where T : unmanaged - { - return device.AllocateReadWriteBuffer(array.AsSpan()); - } - - /// - /// Allocates a new read write buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input with the data to copy on the allocated buffer - /// A read write instance with the contents of the input - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, Span span) where T : unmanaged - { - ReadWriteBuffer buffer = new ReadWriteBuffer(device, span.Length); - buffer.SetData(span); - - return buffer; - } - - /// - /// Allocates a new read write buffer with the specified parameters - /// - /// The type of items to store in the buffer - /// The instance to use to allocate the buffer - /// The input with the data to copy on the allocated buffer - /// A read write instance with the contents of the input - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, HlslBuffer buffer) where T : unmanaged - { - ReadWriteBuffer readWriteBuffer = new ReadWriteBuffer(device, buffer.Size); - readWriteBuffer.SetData(buffer); - - return readWriteBuffer; - } - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs deleted file mode 100644 index bbcc5f32..00000000 --- a/src/ComputeSharp.Graphics/Buffers/ReadOnlyBuffer{T}.cs +++ /dev/null @@ -1,28 +0,0 @@ -using ComputeSharp.Exceptions; -using ComputeSharp.Graphics; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Graphics.Buffers.Enums; - -namespace ComputeSharp -{ - /// - /// A representing a typed readonly buffer stored on GPU memory - /// - /// The type of items stored on the buffer - public sealed class ReadOnlyBuffer : HlslStructuredBuffer where T : unmanaged - { - /// - /// Creates a new instance with the specified parameters - /// - /// The associated with the current instance - /// The number of items to store in the current buffer - internal ReadOnlyBuffer(GraphicsDevice device, int size) : base(device, size, BufferType.ReadOnly) { } - - /// - /// Gets a single value from the current read write buffer - /// - /// The index of the value to get - /// This API can only be used from a compute shader, and will always throw if used anywhere else - public T this[int i] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyBuffer)}[int]"); - } -} diff --git a/src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs deleted file mode 100644 index 3dfdac1e..00000000 --- a/src/ComputeSharp.Graphics/Buffers/ReadWriteBuffer{T}.cs +++ /dev/null @@ -1,28 +0,0 @@ -using ComputeSharp.Exceptions; -using ComputeSharp.Graphics; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Graphics.Buffers.Enums; - -namespace ComputeSharp -{ - /// - /// A representing a typed read write buffer stored on GPU memory - /// - /// The type of items stored on the buffer - public sealed class ReadWriteBuffer : HlslStructuredBuffer where T : unmanaged - { - /// - /// Creates a new instance with the specified parameters - /// - /// The associated with the current instance - /// The number of items to store in the current buffer - internal ReadWriteBuffer(GraphicsDevice device, int size) : base(device, size, BufferType.ReadWrite) { } - - /// - /// Gets or sets a single value from the current read write buffer - /// - /// The index of the value to get or set - /// This API can only be used from a compute shader, and will always throw if used anywhere else - public ref T this[int i] => throw new InvalidExecutionContextException($"{nameof(ReadWriteBuffer)}[int]"); - } -} diff --git a/src/ComputeSharp.Graphics/Commands/Abstract/CommandController.cs b/src/ComputeSharp.Graphics/Commands/Abstract/CommandController.cs deleted file mode 100644 index 618eecfa..00000000 --- a/src/ComputeSharp.Graphics/Commands/Abstract/CommandController.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using Vortice.Direct3D12; - -namespace ComputeSharp.Graphics.Commands.Abstract -{ - /// - /// A base for an instance that deals with GPU commands in some way - /// - internal abstract class CommandController : IDisposable - { - /// - /// Creates a new instance with the specified parameters - /// - /// The input to use to perform requested operations - /// The type of command list to use for the current instance - protected CommandController(GraphicsDevice device, CommandListType commandListType) - { - GraphicsDevice = device; - CommandListType = commandListType; - } - - /// - /// Gets the object targeted by the current instance - /// - public GraphicsDevice GraphicsDevice { get; } - - /// - /// Gets the command list type being used by the current instance - /// - public CommandListType CommandListType { get; } - - /// - public abstract void Dispose(); - } -} diff --git a/src/ComputeSharp.Graphics/Commands/CommandAllocatorPool.cs b/src/ComputeSharp.Graphics/Commands/CommandAllocatorPool.cs deleted file mode 100644 index 700f632c..00000000 --- a/src/ComputeSharp.Graphics/Commands/CommandAllocatorPool.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; -using ComputeSharp.Graphics.Commands.Abstract; -using SharpGen.Runtime; -using Vortice.Direct3D12; - -namespace ComputeSharp.Graphics.Commands -{ - /// - /// A that acts as a pool to get new instances wheen needed - /// - internal sealed class CommandAllocatorPool : CommandController - { - /// - /// The queue of currently pooled instances - /// - private readonly Queue<(ID3D12CommandAllocator CommandAllocator, long FenceValue)> CommandAllocatorQueue = new Queue<(ID3D12CommandAllocator, long)>(); - - /// - public CommandAllocatorPool(GraphicsDevice device, CommandListType commandListType) : base(device, commandListType) { } - - /// - /// Adds a new item to the internal pool queue - /// - /// The input to enqueue - /// The fence value for the input - public void Enqueue(ID3D12CommandAllocator commandAllocator, long fenceValue) - { - lock (CommandAllocatorQueue) - { - CommandAllocatorQueue.Enqueue((commandAllocator, fenceValue)); - } - } - - /// - /// Gets a new or reused item to use to issue GPU commands - /// - [Pure] - public ID3D12CommandAllocator GetCommandAllocator() - { - lock (CommandAllocatorQueue) - { - // Reuse an existing command allocator, if one is present in the queue - if (CommandAllocatorQueue.Count > 0) - { - (ID3D12CommandAllocator commandAllocator, long fenceValue) = CommandAllocatorQueue.Peek(); - - long completedValue = CommandListType switch - { - CommandListType.Compute => GraphicsDevice.NativeComputeFence.CompletedValue, - CommandListType.Copy => GraphicsDevice.NativeCopyFence.CompletedValue, - CommandListType.Direct => GraphicsDevice.NativeDirectFence.CompletedValue, - _ => throw new NotSupportedException($"Unsupported command list type with value {CommandListType}") - }; - - if (fenceValue <= completedValue) - { - CommandAllocatorQueue.Dequeue(); - commandAllocator.Reset(); - - return commandAllocator; - } - } - - // Create a new command allocator - Result result = GraphicsDevice.NativeDevice.CreateCommandAllocator(CommandListType, out ID3D12CommandAllocator? nativeCommandAllocator); - - if (result.Failure) - { - throw new COMException("Failed to create the command allocator", result.Code); - } - - return nativeCommandAllocator!; - } - } - - /// - public override void Dispose() - { - lock (CommandAllocatorQueue) - { - foreach ((ID3D12CommandAllocator commandAllocator, long _) in CommandAllocatorQueue) - { - commandAllocator.Dispose(); - } - - CommandAllocatorQueue.Clear(); - } - } - } -} diff --git a/src/ComputeSharp.Graphics/Commands/CommandList.cs b/src/ComputeSharp.Graphics/Commands/CommandList.cs deleted file mode 100644 index d344b2cf..00000000 --- a/src/ComputeSharp.Graphics/Commands/CommandList.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using ComputeSharp.Exceptions; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Graphics.Commands.Abstract; -using SharpGen.Runtime; -using Vortice.Direct3D12; - -namespace ComputeSharp.Graphics.Commands -{ - /// - /// A that represents a list of commands to issue to a GPU - /// - internal sealed class CommandList : CommandController - { - /// - public CommandList(GraphicsDevice device, CommandListType commandListType) : base(device, commandListType) - { - CommandAllocator = CommandListType switch - { - CommandListType.Compute => GraphicsDevice.ComputeAllocatorPool.GetCommandAllocator(), - CommandListType.Copy => GraphicsDevice.CopyAllocatorPool.GetCommandAllocator(), - CommandListType.Direct => GraphicsDevice.DirectAllocatorPool.GetCommandAllocator(), - _ => throw new NotSupportedException($"Unsupported command list type with value {CommandListType}") - }; - - Result result = GraphicsDevice.NativeDevice.CreateCommandList(0, commandListType, CommandAllocator, null, out ID3D12GraphicsCommandList? nativeCommandList); - - if (result.Failure) - { - throw new COMException("Failed to create the commands list", result.Code); - } - - NativeCommandList = nativeCommandList!; - - // Set the heap descriptor if the command list is not for copy operations - if (CommandListType != CommandListType.Copy) - { - NativeCommandList.SetDescriptorHeaps(1, new[] { GraphicsDevice.ShaderResourceViewAllocator.DescriptorHeap }); - } - } - - - /// - /// Gets the object in use by the current instance - /// - public ID3D12CommandAllocator CommandAllocator { get; } - - /// - /// Gets the object in use by the current instance - /// - public ID3D12GraphicsCommandList NativeCommandList { get; } - - /// - /// Copies a memory region from one resource to another - /// - /// The source to read from - /// The starting offset to read the source resource from - /// The destination to write to - /// The starting offset to write the destination resource from - /// The total number of bytes to copy from one resource to another - public void CopyBufferRegion(GraphicsResource source, long sourceOffset, GraphicsResource destination, long destinationOffset, long numBytes) - { - NativeCommandList.CopyBufferRegion(destination.NativeResource, destinationOffset, source.NativeResource, sourceOffset, numBytes); - } - - /// - /// Binds an input object to a specified root parameter - /// - /// The root parameter index to bind to the input resource - /// The input instance to bind - public void SetComputeRootDescriptorTable(int rootParameterIndex, GraphicsResource resource) - { - if (resource.NativeGpuDescriptorHandle == null) throw new InvalidOperationException("Invalid graphics resource GPU descriptor"); - if (resource.GraphicsDevice != GraphicsDevice) throw new GraphicsDeviceMismatchException(GraphicsDevice, resource); - - NativeCommandList.SetComputeRootDescriptorTable(rootParameterIndex, resource.NativeGpuDescriptorHandle.Value); - } - - /// - /// Sets a given object ready to be executed - /// - /// The input to setup - public void SetPipelineState(PipelineState pipelineState) - { - NativeCommandList.SetComputeRootSignature(pipelineState.RootSignature); - NativeCommandList.SetPipelineState(pipelineState.NativePipelineState); - } - - /// - /// Dispatches the pending shader using the specified thread group values - /// - /// The number of thread groups to schedule for the X axis - /// The number of thread groups to schedule for the Y axis - /// The number of thread groups to schedule for the Z axis - public void Dispatch(int threadGroupCountX, int threadGroupCountY, int threadGroupCountZ) - { - NativeCommandList.Dispatch(threadGroupCountX, threadGroupCountY, threadGroupCountZ); - } - - /// - /// Executes the commands in the current commands list, and waits for completion - /// - public void ExecuteAndWaitForCompletion() - { - NativeCommandList.Close(); - - GraphicsDevice.ExecuteCommandList(this); - } - - /// - public override void Dispose() - { - switch (CommandListType) - { - case CommandListType.Direct: - GraphicsDevice.DirectAllocatorPool.Enqueue(CommandAllocator, GraphicsDevice.NextDirectFenceValue - 1); - break; - case CommandListType.Compute: - GraphicsDevice.ComputeAllocatorPool.Enqueue(CommandAllocator, GraphicsDevice.NextComputeFenceValue - 1); - break; - case CommandListType.Copy: - GraphicsDevice.CopyAllocatorPool.Enqueue(CommandAllocator, GraphicsDevice.NextCopyFenceValue - 1); - break; - default: - throw new NotSupportedException($"Unsupported command list type with value {CommandListType}"); - } - - NativeCommandList.Dispose(); - } - } -} diff --git a/src/ComputeSharp.Graphics/Commands/PipelineState.cs b/src/ComputeSharp.Graphics/Commands/PipelineState.cs deleted file mode 100644 index a7323687..00000000 --- a/src/ComputeSharp.Graphics/Commands/PipelineState.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Vortice.Direct3D12; - -namespace ComputeSharp.Graphics.Commands -{ - /// - /// A representing a custom pipeline state for a compute operation - /// - internal sealed class PipelineState : ComputePipelineStateDescription - { - /// - /// Creates a new instance with the specified parameters - /// - /// The to use - /// The value for the current shader - /// The bytecode for the compute shader to run - public PipelineState(GraphicsDevice device, ID3D12RootSignature rootSignature, ShaderBytecode computeShader) - { - RootSignature = rootSignature; - ComputeShader = computeShader; - - NativePipelineState = device.NativeDevice.CreateComputePipelineState(this); - } - - /// - /// Gets the instance for the current object - /// - public ID3D12PipelineState NativePipelineState { get; } - } -} diff --git a/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj b/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj deleted file mode 100644 index ed47c20e..00000000 --- a/src/ComputeSharp.Graphics/ComputeSharp.Graphics.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - netstandard2.1 - 8.0 - enable - true - - - - - - - - - - - - diff --git a/src/ComputeSharp.Graphics/DescriptorAllocator.cs b/src/ComputeSharp.Graphics/DescriptorAllocator.cs deleted file mode 100644 index a1b92065..00000000 --- a/src/ComputeSharp.Graphics/DescriptorAllocator.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using Vortice.Direct3D12; - -namespace ComputeSharp.Graphics -{ - /// - /// A that provides logic to create resource descriptors for a instance - /// - internal sealed class DescriptorAllocator : IDisposable - { - /// - /// The default number of available descriptors per heap - /// - private const int DescriptorsPerHeap = 4096; - - /// - /// The dummy object used to handle concurrent allocation requests - /// - private readonly object Lock = new object(); - - /// - /// The size of each new descriptor being allocated - /// - private readonly int DescriptorSize; - - /// - /// The current for the instance in use - /// - private CpuDescriptorHandle _CurrentCpuHandle; - - /// - /// The current for the instance in use - /// - private GpuDescriptorHandle _CurrentGpuHandle; - - /// - /// The number of remaining handles to allocate on the current heap - /// - private int _RemainingHandles; - - /// - /// Creates a new instance with the specified parameters - /// - /// The instance to use - public DescriptorAllocator(ID3D12Device device) - { - DescriptorSize = device.GetDescriptorHandleIncrementSize(DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView); - - DescriptorHeapDescription descriptorHeapDescription = new DescriptorHeapDescription - { - DescriptorCount = DescriptorsPerHeap, - Flags = DescriptorHeapFlags.ShaderVisible, - Type = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView - }; - - DescriptorHeap = device.CreateDescriptorHeap(descriptorHeapDescription); - - _RemainingHandles = DescriptorsPerHeap; - _CurrentCpuHandle = DescriptorHeap.GetCPUDescriptorHandleForHeapStart(); - _CurrentGpuHandle = DescriptorHeap.GetGPUDescriptorHandleForHeapStart(); - } - - /// - /// Gets the object in use for the current instance - /// - public ID3D12DescriptorHeap DescriptorHeap { get; } - - /// - /// Allocates a new CPU and GPU handle pair to use in a memory buffer - /// - /// A pair of and to use - public (CpuDescriptorHandle, GpuDescriptorHandle) Allocate() - { - lock (Lock) - { - if (_RemainingHandles == 0) - { - _RemainingHandles = DescriptorHeap.Description.DescriptorCount; - _CurrentCpuHandle = DescriptorHeap.GetCPUDescriptorHandleForHeapStart(); - _CurrentGpuHandle = DescriptorHeap.GetGPUDescriptorHandleForHeapStart(); - } - - CpuDescriptorHandle cpuDescriptorHandle = _CurrentCpuHandle; - GpuDescriptorHandle gpuDescriptorHandle = _CurrentGpuHandle; - - _CurrentCpuHandle += DescriptorSize; - _CurrentGpuHandle += DescriptorSize; - _RemainingHandles -= 1; - - return (cpuDescriptorHandle, gpuDescriptorHandle); - } - } - - /// - public void Dispose() => DescriptorHeap.Dispose(); - } -} diff --git a/src/ComputeSharp.Graphics/Exceptions/GraphicsDeviceMismatchException.cs b/src/ComputeSharp.Graphics/Exceptions/GraphicsDeviceMismatchException.cs deleted file mode 100644 index f3ceeae2..00000000 --- a/src/ComputeSharp.Graphics/Exceptions/GraphicsDeviceMismatchException.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Text; -using ComputeSharp.Graphics; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Graphics.Extensions; - -namespace ComputeSharp.Exceptions -{ - /// - /// A custom that indicates when mismatched devices are being used - /// - public sealed class GraphicsDeviceMismatchException : InvalidOperationException - { - /// - /// Creates a new instance - /// - internal GraphicsDeviceMismatchException(GraphicsDevice device, GraphicsResource resource) : base(GetExceptionMessage(device, resource)) { } - - // Gets a proper exception message for a pair of device and resource - [Pure] - private static string GetExceptionMessage(GraphicsDevice device, GraphicsResource resource) - { - StringBuilder builder = new StringBuilder(); - builder.AppendLine("Invalid pairing of graphics devices used to run a compute shader and allocate memory buffers."); - - // Check if the device is effectively the same but with two instances pointing to the same adapter - if (device.NativeDevice.AdapterLuid == resource.GraphicsDevice.NativeDevice.AdapterLuid) - { - builder.AppendLine("The graphics devices used to allocate buffers and run the shader must be the same instance, not just be using the same physical device."); - builder.AppendLine("You can still run different shaders on different devices, but a shader run on one device must only use buffers allocated by the same device instance."); - } - else - { - // Actually different devices - builder.AppendLine($"The target device to run the compute shader is \"{device.Name}\" (id: {device.NativeDevice.AdapterLuid})."); - builder.AppendLine($"The buffer of type {resource.GetType().ToFriendlyString()} was allocated on device \"{resource.GraphicsDevice.Name}\" (id: {resource.GraphicsDevice.NativeDevice.AdapterLuid})."); - builder.AppendLine("Make sure to always allocate buffers on the same device used to actually run the code that accesses them."); - } - - - return builder.ToString(); - } - } -} diff --git a/src/ComputeSharp.Graphics/Extensions/TypeExtensions.cs b/src/ComputeSharp.Graphics/Extensions/TypeExtensions.cs deleted file mode 100644 index 09001460..00000000 --- a/src/ComputeSharp.Graphics/Extensions/TypeExtensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Linq; - -namespace ComputeSharp.Graphics.Extensions -{ - /// - /// A that provides extension methods for the type - /// - internal static class TypeExtensions - { - /// - /// The mapping of supported known types to display string - /// - private static readonly IReadOnlyDictionary KnownTypes = new Dictionary - { - [typeof(bool)] = "bool", - [typeof(int)] = "int", - [typeof(uint)] = "uint", - [typeof(float)] = "float", - [typeof(double)] = "double" - }; - - /// - /// Gets a friendly display for the input type - /// - /// The input type to analyze - [Pure] - public static string ToFriendlyString(this Type type) - { - // Array types of arbitrary rank - if (type.IsArray) - { - int rank = type.GetArrayRank(); - return $"{type.GetElementType().ToFriendlyString()}[{new string(Enumerable.Repeat(',', rank - 1).ToArray())}]"; - } - - // Non generic types - string name; - if (type.GetGenericArguments().Length == 0) return KnownTypes.TryGetValue(type, out name) ? name : type.Name; - - // Generic types - Type[] genericArguments = type.GetGenericArguments(); - string typeDefeninition = KnownTypes.TryGetValue(type, out name) ? name : type.Name; - string polishedName = typeDefeninition.Substring(0, typeDefeninition.IndexOf("`")); - return $"{polishedName}<{string.Join(",", genericArguments.Select(ToFriendlyString))}>"; - } - } -} diff --git a/src/ComputeSharp.Graphics/GraphicsDevice.cs b/src/ComputeSharp.Graphics/GraphicsDevice.cs deleted file mode 100644 index c4ce6180..00000000 --- a/src/ComputeSharp.Graphics/GraphicsDevice.cs +++ /dev/null @@ -1,234 +0,0 @@ -using System; -using ComputeSharp.Graphics.Commands; -using Vortice.Direct3D12; -using Vortice.DXGI; -using CommandList = ComputeSharp.Graphics.Commands.CommandList; -using Direct3DFeatureLevel = Vortice.Direct3D.FeatureLevel; - -namespace ComputeSharp.Graphics -{ - /// - /// A that represents a DX12.1-compatible GPU device that can be used to run compute shaders - /// - public sealed class GraphicsDevice : IDisposable - { - /// - /// Gets the value that needs to be supported by GPUs mapped to a instance - /// - public const Direct3DFeatureLevel FeatureLevel = Direct3DFeatureLevel.Level_12_1; - - /// - /// The instance to use for compute operations - /// - private readonly ID3D12CommandQueue NativeComputeCommandQueue; - - /// - /// The instance to use for copy operations - /// - private readonly ID3D12CommandQueue NativeCopyCommandQueue; - - /// - /// The instance to use for direct operations - /// - private readonly ID3D12CommandQueue NativeDirectCommandQueue; - - /// - /// Creates a new instance for the input - /// - /// The to use for the new instance - /// The available info for the new instance - public GraphicsDevice(ID3D12Device device, AdapterDescription description) - { - NativeDevice = device; - Name = description.Description; - MemorySize = description.DedicatedVideoMemory; - ComputeUnits = device.Options1.TotalLaneCount; - WavefrontSize = device.Options1.WaveLaneCountMin; - - NativeComputeCommandQueue = NativeDevice.CreateCommandQueue(new CommandQueueDescription(CommandListType.Compute)); - NativeCopyCommandQueue = NativeDevice.CreateCommandQueue(new CommandQueueDescription(CommandListType.Copy)); - NativeDirectCommandQueue = NativeDevice.CreateCommandQueue(new CommandQueueDescription(CommandListType.Direct)); - - ComputeAllocatorPool = new CommandAllocatorPool(this, CommandListType.Compute); - CopyAllocatorPool = new CommandAllocatorPool(this, CommandListType.Copy); - DirectAllocatorPool = new CommandAllocatorPool(this, CommandListType.Direct); - - NativeComputeFence = NativeDevice.CreateFence(0); - NativeCopyFence = NativeDevice.CreateFence(0); - NativeDirectFence = NativeDevice.CreateFence(0); - - ShaderResourceViewAllocator = new DescriptorAllocator(NativeDevice); - } - - /// - /// Gets the name of the current instance - /// - public string Name { get; } - - /// - /// Gets the size of the dedicated video memory for the current instance - /// - public long MemorySize { get; } - - /// - /// Gets the number of total lanes on the current device (eg. CUDA cores on an nVidia GPU) - /// - public int ComputeUnits { get; } - - /// - /// Gets the number of lanes in a SIMD wave on the current device (also known as "wavefront size" or "warp width") - /// - public int WavefrontSize { get; } - - /// - /// Gets the object wrapped by the current instance - /// - internal ID3D12Device NativeDevice { get; } - - /// - /// Gets the object for the current instance, used when allocating new buffers - /// - internal DescriptorAllocator ShaderResourceViewAllocator { get; set; } - - /// - /// Gets the instance for compute operations - /// - internal CommandAllocatorPool ComputeAllocatorPool { get; } - - /// - /// Gets the instance for copy operations - /// - internal CommandAllocatorPool CopyAllocatorPool { get; } - - /// - /// Gets the instance for direct operations - /// - internal CommandAllocatorPool DirectAllocatorPool { get; } - - /// - /// Gets the instance used for compute operations - /// - internal ID3D12Fence NativeComputeFence { get; } - - /// - /// Gets the instance used for copy operations - /// - internal ID3D12Fence NativeCopyFence { get; } - - /// - /// Gets the instance used for direct operations - /// - internal ID3D12Fence NativeDirectFence { get; } - - /// - /// Gets the next fence value for compute operations - /// - internal long NextComputeFenceValue { get; private set; } = 1; - - /// - /// Gets the next fence value for copy operations - /// - internal long NextCopyFenceValue { get; private set; } = 1; - - /// - /// Gets the next fence value for direct operations - /// - internal long NextDirectFenceValue { get; private set; } = 1; - - /// - /// Creates a instance from a description - /// - /// A instance with the info for the new object to create - /// A new instance to use in a compute shader - internal ID3D12RootSignature CreateRootSignature(VersionedRootSignatureDescription rootSignatureDescription) - { - return NativeDevice.CreateRootSignature(0, rootSignatureDescription); - } - - /// - /// Executes a and waits for the GPU to finish processing it - /// - /// The input to execute - internal void ExecuteCommandList(CommandList commandList) - { - ID3D12Fence fence = commandList.CommandListType switch - { - CommandListType.Direct => NativeDirectFence, - CommandListType.Compute => NativeComputeFence, - CommandListType.Copy => NativeCopyFence, - _ => throw new NotSupportedException("This command list type is not supported.") - }; - - long fenceValue = GetFenceValueForCommandList(commandList); - - if (fenceValue <= fence.CompletedValue) return; - - fence.SetEventOnCompletion(fenceValue, default(IntPtr)); - } - - /// - /// Executes a and, signals and retrieves the following fence value - /// - /// The input to execute - /// The value of the new fence to wait for - private long GetFenceValueForCommandList(CommandList commandList) - { - CommandAllocatorPool commandAllocatorPool; - ID3D12CommandQueue commandQueue; - ID3D12Fence fence; - long fenceValue; - - switch (commandList.CommandListType) - { - case CommandListType.Compute: - commandAllocatorPool = ComputeAllocatorPool; - commandQueue = NativeComputeCommandQueue; - fence = NativeComputeFence; - fenceValue = NextComputeFenceValue++; - break; - case CommandListType.Copy: - commandAllocatorPool = CopyAllocatorPool; - commandQueue = NativeCopyCommandQueue; - fence = NativeCopyFence; - fenceValue = NextCopyFenceValue++; - break; - case CommandListType.Direct: - commandAllocatorPool = DirectAllocatorPool; - commandQueue = NativeDirectCommandQueue; - fence = NativeDirectFence; - fenceValue = NextDirectFenceValue++; - break; - default: throw new NotSupportedException($"Unsupported command list of type {commandList.CommandListType}"); - } - - commandAllocatorPool.Enqueue(commandList.CommandAllocator, fenceValue); - commandQueue.ExecuteCommandLists(commandList.NativeCommandList); - commandQueue.Signal(fence, fenceValue); - - return fenceValue; - } - - /// - public void Dispose() - { - NativeDirectCommandQueue.Signal(NativeDirectFence, NextDirectFenceValue); - NativeDirectCommandQueue.Wait(NativeDirectFence, NextDirectFenceValue); - - ShaderResourceViewAllocator.Dispose(); - - ComputeAllocatorPool.Dispose(); - CopyAllocatorPool.Dispose(); - DirectAllocatorPool.Dispose(); - - NativeComputeCommandQueue.Dispose(); - NativeCopyCommandQueue.Dispose(); - NativeDirectCommandQueue.Dispose(); - - NativeComputeFence.Dispose(); - NativeDirectFence.Dispose(); - NativeDirectFence.Dispose(); - - NativeDevice.Dispose(); - } - } -} diff --git a/src/ComputeSharp.Graphics/Helpers/DeviceHelper.cs b/src/ComputeSharp.Graphics/Helpers/DeviceHelper.cs deleted file mode 100644 index b09990a0..00000000 --- a/src/ComputeSharp.Graphics/Helpers/DeviceHelper.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using Vortice.Direct3D; -using Vortice.Direct3D12; -using Vortice.DXGI; - -namespace ComputeSharp.Graphics.Helpers -{ - /// - /// A with methods to inspect the available devices on the current machine - /// - internal static class DeviceHelper - { - /// - /// Gets a collection of all the supported devices on the current machine - /// - /// The collection of objects with support for DX12.1 - [Pure] - public static IReadOnlyList<(ID3D12Device, AdapterDescription)> QueryAllSupportedDevices() - { - if (!DXGI.CreateDXGIFactory1(out IDXGIFactory1 factory).Success) return new (ID3D12Device, AdapterDescription)[0]; - try - { - List<(ID3D12Device, AdapterDescription)> devices = new List<(ID3D12Device, AdapterDescription)>(); - - int i = 0; - - while (factory.EnumAdapters1(i++, out IDXGIAdapter1? adapter).Success && !(adapter is null)) - { - if (adapter.Description.DedicatedVideoMemory == 0) continue; - - if (D3D12.D3D12CreateDevice(adapter, FeatureLevel.Level_12_0, out ID3D12Device device).Success) - { - devices.Add((device, adapter.Description)); - } - } - - return devices; - } - finally - { - // Explicit using statement - factory?.Dispose(); - } - } - } -} diff --git a/src/ComputeSharp.Graphics/Helpers/MemoryHelper.cs b/src/ComputeSharp.Graphics/Helpers/MemoryHelper.cs deleted file mode 100644 index b9911acb..00000000 --- a/src/ComputeSharp.Graphics/Helpers/MemoryHelper.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Graphics.Helpers -{ - /// - /// A with some helper methods to copy data between memory areas - /// - internal static class MemoryHelper - { - /// - /// Copies the content of a to the area pointed by an input value - /// - /// The type of values in the input - /// The source to read - /// The for the destination memory area - /// The destination offset to start writing data to - /// The total number of items to copy - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe void Copy(ReadOnlySpan source, IntPtr destination, int destinationOffset, int count) where T : unmanaged - { - T* p = (T*)destination.ToPointer() + destinationOffset; - - source.CopyTo(new Span(p, count)); - } - - /// - /// Copies a memory area pointed by an value to a target - /// - /// The type of values to read - /// The that indicates the memory area to read from - /// The source offset to start reading data from - /// The destination to write - /// The destination offset to start writing data to - /// The total number of items to copy - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe void Copy(IntPtr source, int sourceOffset, Span destination, int destinationOffset, int count) where T : unmanaged - { - ref T rin = ref Unsafe.AsRef(source.ToPointer()); - void* target = Unsafe.AsPointer(ref Unsafe.Add(ref rin, sourceOffset)); - new Span(target, count).CopyTo(destination.Slice(destinationOffset, count)); - } - } -} diff --git a/src/ComputeSharp.Graphics/Properties/AssemblyInfo.cs b/src/ComputeSharp.Graphics/Properties/AssemblyInfo.cs deleted file mode 100644 index cf072a97..00000000 --- a/src/ComputeSharp.Graphics/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("ComputeSharp")] -[assembly: InternalsVisibleTo("ComputeSharp.Shaders")] -[assembly: InternalsVisibleTo("ComputeSharp.Tests.Internals")] - diff --git a/src/ComputeSharp.Package/ComputeSharp.Package.msbuildproj b/src/ComputeSharp.Package/ComputeSharp.Package.msbuildproj new file mode 100644 index 00000000..dd866f2c --- /dev/null +++ b/src/ComputeSharp.Package/ComputeSharp.Package.msbuildproj @@ -0,0 +1,34 @@ + + + + net5.0 + + + + ComputeSharp + ComputeSharp + A library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders + 2.0.0 + https://github.com/Sergio0694/ComputeSharp.git + git + https://github.com/Sergio0694/ComputeSharp + Sergio Pedri + Sergio Pedri + Copyright (c) 2021 Sergio Pedri + MIT + true + icon.png + https://user-images.githubusercontent.com/10199417/110238403-b8811080-7f41-11eb-8cfe-e47e7e58f05b.png + dotnet net netcore netstandard csharp library graphics shader hlsl compute gpu performance parallel + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ComputeSharp.Package/icon.png b/src/ComputeSharp.Package/icon.png new file mode 100644 index 00000000..c50791a3 Binary files /dev/null and b/src/ComputeSharp.Package/icon.png differ diff --git a/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj b/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj deleted file mode 100644 index 9951368f..00000000 --- a/src/ComputeSharp.Shaders/ComputeSharp.Shaders.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - netstandard2.1 - 8.0 - enable - - - - - - - - - - - - - - - - Never - - - - diff --git a/src/ComputeSharp.Shaders/Exceptions/HlslCompilationException.cs b/src/ComputeSharp.Shaders/Exceptions/HlslCompilationException.cs deleted file mode 100644 index 13a95b6d..00000000 --- a/src/ComputeSharp.Shaders/Exceptions/HlslCompilationException.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Text; - -namespace ComputeSharp.Exceptions -{ - /// - /// A custom that indicates when mismatched devices are being used - /// - public sealed class HlslCompilationException : Exception - { - /// - /// Creates a new instance - /// - /// The error message produced by the Dxc compiler - internal HlslCompilationException(string error) : base(GetExceptionMessage(error)) { } - - // Gets a proper exception message for a given compilation error - [Pure] - private static string GetExceptionMessage(string error) - { - StringBuilder builder = new StringBuilder(); - builder.Append("The Dxc compiler encountered an error while trying to compile the shader."); - builder.AppendLine("Make sure to only be using supported features by checking the README file in the ComputeSharp repository: https://github.com/Sergio0694/ComputeSharp."); - builder.AppendLine("If you're sure that your C# shader code is valid, please open an issue an include a working repro and the following error message:"); - builder.AppendLine(error.TrimEnd()); - - return builder.ToString(); - } - } -} diff --git a/src/ComputeSharp.Shaders/Extensions/DynamicMethod{T}.cs b/src/ComputeSharp.Shaders/Extensions/DynamicMethod{T}.cs deleted file mode 100644 index 3b08edd3..00000000 --- a/src/ComputeSharp.Shaders/Extensions/DynamicMethod{T}.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Diagnostics.Contracts; -using System.Linq; -using System.Threading; - -namespace System.Reflection.Emit -{ - /// - /// A that can be used to easily (lol) create dynamic methods - /// - /// The type of that will be used to wrap the new methods - internal static class DynamicMethod where T : Delegate - { - /// - /// The owner type for new dynamic methods - /// - private static readonly Type OwnerType = typeof(DynamicMethod); - - /// - /// The return type of the - /// - private static readonly Type ReturnType; - - /// - /// The types of the arguments of the - /// - private static readonly Type[] ParameterTypes; - - /// - /// Loads all the necessary info for the current parameter - /// - static DynamicMethod() - { - MethodInfo method = typeof(T).GetMethod("Invoke"); - ReturnType = method.ReturnType; - ParameterTypes = method.GetParameters().Select(p => p.ParameterType).ToArray(); - } - - /// - /// Local counter for dynamic methods of type ever generated - /// - private static int _Count; - - /// - /// Creates a new for the target owner - /// - /// An that builds the IL bytecode for the new method - /// A new dynamic method wrapped as a - [Pure] - public static T New(Action builder) - { - // Create a new dynamic method with a unique id - string id = $"__IL__{typeof(T).Name}_{Interlocked.Increment(ref _Count)}"; - DynamicMethod method = new DynamicMethod(id, ReturnType, ParameterTypes, OwnerType); - - // Build the IL bytecode - ILGenerator il = method.GetILGenerator(); - builder(il); - - // Build and delegate instance - return (T)method.CreateDelegate(typeof(T)); - } - } -} diff --git a/src/ComputeSharp.Shaders/Extensions/ILGeneratorExtensions.cs b/src/ComputeSharp.Shaders/Extensions/ILGeneratorExtensions.cs deleted file mode 100644 index eb251143..00000000 --- a/src/ComputeSharp.Shaders/Extensions/ILGeneratorExtensions.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace System.Reflection.Emit -{ - /// - /// A that provides extension methods for the type - /// - internal static class ILGeneratorExtensions - { - /// - /// Puts the appropriate , , or instruction to read a member onte the stream of instructions - /// - /// The input instance to use to emit instructions - /// The member to read - public static void EmitReadMember(this ILGenerator il, MemberInfo member) - { - switch (member) - { - case FieldInfo field: - il.Emit(field.IsStatic ? OpCodes.Ldsfld : OpCodes.Ldfld, field); - break; - case PropertyInfo property when property.CanRead: - il.EmitCall(property.GetMethod.IsStatic ? OpCodes.Call : OpCodes.Callvirt, property.GetMethod, null); - break; - default: throw new ArgumentException($"The input {member.GetType()} instance can't be read"); - } - } - - /// - /// Puts the appropriate , and instructions to advance a reference onto the stream of instructions - /// - /// The type of reference at the top of the stack - /// The input instance to use to emit instructions - /// The offset to use to advance the current reference on top of the execution stack - public static void EmitAddOffset(this ILGenerator il, int offset) => il.EmitAddOffset(Unsafe.SizeOf() * offset); - - /// - /// Puts the appropriate , and instructions to advance a reference onto the stream of instructions - /// - /// The input instance to use to emit instructions - /// The offset in bytes to use to advance the current reference on top of the execution stack - public static void EmitAddOffset(this ILGenerator il, int offset) - { - // Push the offset to the stack - if (offset < -128) il.Emit(OpCodes.Ldc_I4, offset); - else if (offset < 0) il.Emit(OpCodes.Ldc_I4_S, (sbyte)offset); - else if (offset <= 8) - { - il.Emit(offset switch - { - 0 => OpCodes.Ldc_I4_0, - 1 => OpCodes.Ldc_I4_1, - 2 => OpCodes.Ldc_I4_2, - 3 => OpCodes.Ldc_I4_3, - 4 => OpCodes.Ldc_I4_4, - 5 => OpCodes.Ldc_I4_5, - 6 => OpCodes.Ldc_I4_6, - 7 => OpCodes.Ldc_I4_7, - 8 => OpCodes.Ldc_I4_8, - _ => throw new InvalidOperationException($"Invalid offset value [{offset}]") - }); - } - else if (offset <= 127) il.Emit(OpCodes.Ldc_I4_S, (byte)offset); - else il.Emit(OpCodes.Ldc_I4, offset); - - // Converts the offset to native int and adds to the address - il.Emit(OpCodes.Conv_I); - il.Emit(OpCodes.Add); - } - - /// - /// Puts the appropriate or instruction to write to a reference onto the stream of instructions - /// - /// The input instance to use to emit instructions - /// The type of value being written to the current reference on top of the execution stack - public static void EmitStoreToAddress(this ILGenerator il, Type type) - { - if (type.IsValueType) - { - // Pick the optimal opcode to set a value type - OpCode opcode = Marshal.SizeOf(type) switch - { - // Use the faster op codes for sizes <= 8 - 1 when type == typeof(bool) || type == typeof(byte) || type == typeof(sbyte) => OpCodes.Stind_I1, - 2 when type == typeof(short) || type == typeof(ushort) => OpCodes.Stind_I2, - 4 when type == typeof(float) => OpCodes.Stind_R4, - 4 when type == typeof(int) || type == typeof(uint) => OpCodes.Stind_I4, - 8 when type == typeof(double) => OpCodes.Stind_R8, - 8 when type == typeof(long) || type == typeof(ulong) => OpCodes.Stind_I8, - - // Default to stobj for all other value types - _ => OpCodes.Stobj - }; - - // Also pass the type token if stobj is used - if (opcode == OpCodes.Stobj) il.Emit(opcode, type); - else il.Emit(opcode); - } - else il.Emit(OpCodes.Stind_Ref); - } - } -} diff --git a/src/ComputeSharp.Shaders/Extensions/StringExtensions.cs b/src/ComputeSharp.Shaders/Extensions/StringExtensions.cs deleted file mode 100644 index 16f21407..00000000 --- a/src/ComputeSharp.Shaders/Extensions/StringExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Diagnostics.Contracts; -using System.Linq; -using System.Text.RegularExpressions; - -namespace System -{ - /// - /// A that provides extension methods for the type - /// - internal static class StringExtensions - { - /// - /// Removes the left padding for an input multiline - /// - /// The input to process - /// A left-aligned with the same text as the input - [Pure] - public static string RemoveLeftPadding(this string text) - { - string[] lines = text.Split(Environment.NewLine); - int spaces = text.TakeWhile(c => c == ' ').Count(); - Regex regex = new Regex($"^{new string(Enumerable.Repeat(' ', spaces).ToArray())}"); - - return lines.Aggregate(string.Empty, (result, line) => $"{result}{Environment.NewLine}{regex.Replace(line, string.Empty)}"); - } - } -} diff --git a/src/ComputeSharp.Shaders/Extensions/SyntaxNodeExtensions.cs b/src/ComputeSharp.Shaders/Extensions/SyntaxNodeExtensions.cs deleted file mode 100644 index 1f00c8b9..00000000 --- a/src/ComputeSharp.Shaders/Extensions/SyntaxNodeExtensions.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Globalization; -using System.Linq; -using System.Reflection; -using ComputeSharp; -using ComputeSharp.Shaders.Mappings; -using ComputeSharp.Shaders.Translation.Models; - -namespace Microsoft.CodeAnalysis.CSharp.Syntax -{ - /// - /// A with some extension methods for C# syntax nodes - /// - internal static class SyntaxNodeExtensions - { - /// - /// Checks a value and replaces the value type to be HLSL compatible, if needed - /// - /// The type of the input instance - /// The input to check and modify if needed - /// The to use for the input node - /// A instance that represents a type compatible with HLSL - [Pure] - public static TRoot ReplaceType(this TRoot node, TypeSyntax type) where TRoot : SyntaxNode - { - string value = HlslKnownTypes.GetMappedName(type.ToString()); - - // If the HLSL mapped full type name equals the original type, just return the input node - if (value == type.ToString()) return node; - - // Process and return the type name - TypeSyntax newType = SyntaxFactory.ParseTypeName(value).WithLeadingTrivia(type.GetLeadingTrivia()).WithTrailingTrivia(type.GetTrailingTrivia()); - return node.ReplaceNode(type, newType); - } - - /// - /// Checks a instance and replaces it to be HLSL compatible, if needed - /// - /// The input to check and modify if needed - /// The to use to load symbols for the input node - /// The info on parsed static members, if any - /// The info on parsed static methods, if any - /// A instance that is compatible with HLSL - [Pure] - public static SyntaxNode ReplaceMember(this MemberAccessExpressionSyntax node, SemanticModel semanticModel, out (string Name, ReadableMember MemberInfo)? variable, out (string Name, MethodInfo MethodInfo)? method) - { - // Set the out parameters to null, replace them later on if needed - variable = null; - method = null; - - SymbolInfo containingMemberSymbolInfo; - ISymbol? memberSymbol; - try - { - containingMemberSymbolInfo = semanticModel.GetSymbolInfo(node.Expression); - SymbolInfo memberSymbolInfo = semanticModel.GetSymbolInfo(node.Name); - memberSymbol = memberSymbolInfo.Symbol ?? memberSymbolInfo.CandidateSymbols.FirstOrDefault(); - } - catch (ArgumentException) - { - // Member access on a captured HLSL-compatible field or property - string name = node.Name.ToFullString(); - if (name == "X" || name == "Y" || name == "Z" || name == "W") return node.WithName(SyntaxFactory.IdentifierName(name.ToLowerInvariant())); - return node; - } - - // If the input member has no symbol, try to load it manually - if (memberSymbol is null) - { - string expression = node.WithoutTrivia().ToFullString(); - int index = expression.LastIndexOf(Type.Delimiter); - string fullname = expression.Substring(0, index); - if (!(AppDomain.CurrentDomain.GetAssemblies().Select(a => a.GetType(fullname)).FirstOrDefault(t => t != null) is Type type)) - { - // The current node can't possibly represent a field or a property, so just return it - return node; - } - - // Try to get the target static field or property, if present - string name = expression.Substring(index + 1, expression.Length - fullname.Length - 1); - MemberInfo[] memberInfos = type.GetMember(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); - if (memberInfos.Length == 0) return node; - bool isReadonly; - ReadableMember memberInfo; - switch (memberInfos.First()) - { - case FieldInfo fieldInfo: - isReadonly = fieldInfo.IsInitOnly; - memberInfo = fieldInfo; - break; - case PropertyInfo propertyInfo: - isReadonly = !propertyInfo.CanWrite; - memberInfo = propertyInfo; - break; - case MethodInfo methodInfo: - string methodName = $"{methodInfo.DeclaringType.Name}_{methodInfo.Name}"; - method = (methodName, methodInfo); - return SyntaxFactory.IdentifierName(methodName).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - default: throw new InvalidOperationException($"Invalid symbol kind: {memberInfos.First().GetType()}"); - } - - // Handle the loaded info - return ProcessStaticMember(node, memberInfo, isReadonly, ref variable); - } - - // If the input member is not a field, property or method, just return it - if (memberSymbol.Kind != SymbolKind.Field && - memberSymbol.Kind != SymbolKind.Property && - memberSymbol.Kind != SymbolKind.Method) - { - return node; - } - - // Process the input node if it's a known method invocation - if (HlslKnownMethods.TryGetMappedName(containingMemberSymbolInfo.Symbol, memberSymbol, out string? mappedName)) - { - string expression = memberSymbol.IsStatic ? mappedName : $"{node.Expression}{mappedName}"; - return SyntaxFactory.IdentifierName(expression).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - } - - // Handle static members as a special case - if (memberSymbol.IsStatic && ( - memberSymbol.Kind == SymbolKind.Field || - memberSymbol.Kind == SymbolKind.Property || - memberSymbol.Kind == SymbolKind.Method)) - { - // Get the containing type - string - typeFullname = memberSymbol.ContainingType.ToString(), - assemblyFullname = memberSymbol.ContainingAssembly.ToString(); - Type memberDeclaringType = Type.GetType($"{typeFullname}, {assemblyFullname}"); - - // Static field or property - if (memberSymbol.Kind == SymbolKind.Field || memberSymbol.Kind == SymbolKind.Property) - { - bool isReadonly; - ReadableMember memberInfo; - switch (memberSymbol.Kind) - { - case SymbolKind.Field: - FieldInfo fieldInfo = memberDeclaringType.GetField(memberSymbol.Name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); - isReadonly = fieldInfo.IsInitOnly; - memberInfo = fieldInfo; - break; - case SymbolKind.Property: - PropertyInfo propertyInfo = memberDeclaringType.GetProperty(memberSymbol.Name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); - isReadonly = !propertyInfo.CanWrite; - memberInfo = propertyInfo; - break; - default: throw new InvalidOperationException($"Invalid symbol kind: {memberSymbol.Kind}"); - } - - // Handle the loaded info - return ProcessStaticMember(node, memberInfo, isReadonly, ref variable); - } - - // Static method - MethodInfo methodInfo = memberDeclaringType.GetMethod(memberSymbol.Name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); - string name = $"{methodInfo.DeclaringType.Name}_{methodInfo.Name}"; - method = (name, methodInfo); - - return SyntaxFactory.IdentifierName(name).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - } - - return node; - } - - /// - /// Checks a instance and replaces it to be HLSL compatible, if needed - /// - /// The input to check and modify if needed - /// The in which the input syntax tree is declared in - /// The info on parsed static members, if any - /// The info on parsed static methods, if any - /// A instance that is compatible with HLSL - [Pure] - public static InvocationExpressionSyntax ReplaceInvocation(this InvocationExpressionSyntax node, Type declaringType, out (string Name, ReadableMember MemberInfo)? variable, out (string Name, MethodInfo MethodInfo)? method) - { - // Set the variable and method to null - variable = null; - method = null; - - // Explore the nested classes from bottom to top - if (declaringType.TryFindAncestorMember(node.Expression.ToString(), BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, out var result)) - { - // If a static method or delegate is found, track it - string name = $"{result.Value.DeclaringType.Name}_{result.Value.MemberInfo.Name}"; - switch (result.Value.MemberInfo) - { - case FieldInfo fieldInfo: - variable = (name, fieldInfo); - break; - case PropertyInfo propertyInfo: - variable = (name, propertyInfo); - break; - case MethodInfo methodInfo: - method = (name, methodInfo); - return SyntaxFactory.InvocationExpression(SyntaxFactory.ParseExpression(name), node.ArgumentList).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - default: throw new InvalidOperationException($"Invalid symbol kind: {result.Value.MemberInfo.GetType()}"); - } - - // Return the mapped expression - return SyntaxFactory.InvocationExpression(SyntaxFactory.ParseExpression(name), node.ArgumentList).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - } - - return node; - } - - /// - /// Checks a instance and replaces it to be HLSL compatible, if needed - /// - /// The input to check and modify if needed - /// The in which the input syntax tree is declared in - /// The info on parsed static members, if any - /// A instance that is compatible with HLSL - [Pure] - public static IdentifierNameSyntax ReplaceIdentifierName(this IdentifierNameSyntax node, Type declaringType, out (string Name, ReadableMember MemberInfo)? variable) - { - // Set the variable to null - variable = null; - - // Explore the nested classes from bottom to top - if (declaringType.TryFindAncestorMember(node.Identifier.ToString(), BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, out var result)) - { - // If a static scalar or vector member is found, track it - string name = $"{result.Value.DeclaringType.Name}_{result.Value.MemberInfo.Name}"; - switch (result.Value.MemberInfo) - { - case FieldInfo fieldInfo when HlslKnownTypes.IsKnownType(fieldInfo.FieldType): - variable = (name, fieldInfo); - break; - case PropertyInfo propertyInfo when HlslKnownTypes.IsKnownType(propertyInfo.PropertyType): - variable = (name, propertyInfo); - break; - default: return node; - } - - // Return the mapped expression - return SyntaxFactory.IdentifierName(name).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - } - - return node; - } - - /// - /// Processes a loaded static member, either a field or a property - /// - /// The input to check and modify if needed - /// The wrapped member that needs to be processed - /// Indicates whether or not the target member is readonly - /// The info on parsed static members, if any - /// A instance that is compatible with HLSL - private static SyntaxNode ProcessStaticMember(SyntaxNode node, ReadableMember memberInfo, bool isReadonly, ref (string Name, ReadableMember MemberInfo)? variable) - { - // Constant replacement if the value is a readonly scalar value - if (isReadonly && HlslKnownTypes.IsKnownScalarType(memberInfo.MemberType)) - { - LiteralExpressionSyntax expression = memberInfo.GetValue(null) switch - { - true => SyntaxFactory.LiteralExpression(SyntaxKind.TrueLiteralExpression, SyntaxFactory.Token(SyntaxKind.TrueKeyword)), - false => SyntaxFactory.LiteralExpression(SyntaxKind.TrueLiteralExpression, SyntaxFactory.Token(SyntaxKind.FalseKeyword)), - Bool b when b => SyntaxFactory.LiteralExpression(SyntaxKind.TrueLiteralExpression, SyntaxFactory.Token(SyntaxKind.TrueKeyword)), - Bool b when !b => SyntaxFactory.LiteralExpression(SyntaxKind.TrueLiteralExpression, SyntaxFactory.Token(SyntaxKind.FalseKeyword)), - IFormattable scalar => SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.ParseToken(scalar.ToString(null, CultureInfo.InvariantCulture))), - _ => throw new InvalidOperationException($"Invalid field of type {memberInfo.MemberType}") - }; - return expression.WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - } - - // Captured member, treat it like any other captured variable in the closure - string name = $"{memberInfo.DeclaringType.Name}_{memberInfo.Name}"; - variable = (name, memberInfo); - return SyntaxFactory.IdentifierName(name).WithLeadingTrivia(node.GetLeadingTrivia()).WithTrailingTrivia(node.GetTrailingTrivia()); - } - } -} diff --git a/src/ComputeSharp.Shaders/Extensions/TypeExtensions.cs b/src/ComputeSharp.Shaders/Extensions/TypeExtensions.cs deleted file mode 100644 index 56b40454..00000000 --- a/src/ComputeSharp.Shaders/Extensions/TypeExtensions.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Diagnostics.Contracts; -using System.Reflection; -using System.Runtime.CompilerServices; - -namespace System -{ - /// - /// A that provides extension methods for the type - /// - internal static class TypeExtensions - { - /// - /// Gets whether or not the input represents a - /// - /// The input type to analyze - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsDelegate(this Type type) => type.IsClass && - type.IsSubclassOf(typeof(Delegate)); - - /// - /// Gets whether or not the input represents a with no captured variables - /// - /// The input type to analyze - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsStatelessDelegateContainer(this Type type) => type.GetFields(BindingFlags.Static | BindingFlags.Public).Length > 0; - - /// - /// Tries to find an ancestor member starting from the input - /// - /// The input type to start the search from - /// The name of the member to retrieve - /// A bitmask comprised of one or more that specify how the search is conducted - /// when a member with the given name is found, otherwise - public static bool TryFindAncestorMember(this Type type, string name, BindingFlags bindingAttr, [NotNullWhen(true)] out (Type DeclaringType, MemberInfo MemberInfo)? result) - { - while ((type = type.DeclaringType) != null) - { - MemberInfo[] memberInfos = type.GetMember(name, bindingAttr); - if (memberInfos.Length > 0) - { - result = (type, memberInfos[0]); - return true; - } - } - - result = null; - return false; - } - } -} diff --git a/src/ComputeSharp.Shaders/Mappings/HlslKnownKeywords.cs b/src/ComputeSharp.Shaders/Mappings/HlslKnownKeywords.cs deleted file mode 100644 index 4e7dd21e..00000000 --- a/src/ComputeSharp.Shaders/Mappings/HlslKnownKeywords.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Text.RegularExpressions; - -namespace ComputeSharp.Shaders.Mappings -{ - /// - /// A that contains and maps known HLSL method names to common .NET method - /// - internal static class HlslKnownKeywords - { - /// - /// The mapping of supported known methods to HLSL methods - /// - private static readonly IReadOnlyCollection KnownKeywords = new[] - { - "asm", "asm_fragment", "cbuffer", "centroid", "column_major", - "compile", "discard", "dword", "export", "fxgroup", "groupshared", - "half", "inline", "inout", "line", "lineadj", "linear", "matrix", - "nointerpolation", "noperspective", "NULL", "packoffset", "pass", - "pixelfragment", "point", "precise", "register", "row_major", "sample", - "sampler", "shared", "snorm", "stateblock", "stateblock_state", "tbuffer", - "technique", "typedef", "triangle", "triangleadj", "uniform", "unorm", - "unsigned", "vector", "vertexfragment", "zero" - }; - - private static Regex? _KeywordsRegex; - - /// - /// The to use to match variable names - /// - private static Regex KeywordsRegex - { - get - { - if (_KeywordsRegex == null) - { - string - keywords = string.Join("|", KnownKeywords), - pattern = $@"(? - /// Gets the mapped HLSL-compatible variable name for the input identifier name - /// - /// The input variable name to map - /// The HLSL-compatible variable name name that can be used in an HLSL shader - [Pure] - public static string GetMappedName(string name) => KeywordsRegex.IsMatch(name) ? $"_{name}" : name; - - /// - /// Processes an input text and replaces all the occurrences of reserved keywords - /// - /// The input text to process - /// A valid shader body source code that can be used in HLSL - [Pure] - public static string GetMappedText(string text) => KeywordsRegex.Replace(text, m => $"_{m.Value}"); - } -} diff --git a/src/ComputeSharp.Shaders/Mappings/HlslKnownMethods.cs b/src/ComputeSharp.Shaders/Mappings/HlslKnownMethods.cs deleted file mode 100644 index 8f8e92dd..00000000 --- a/src/ComputeSharp.Shaders/Mappings/HlslKnownMethods.cs +++ /dev/null @@ -1,285 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Diagnostics.Contracts; -using System.Linq; -using System.Reflection; -using ComputeSharp.Core.Attributes; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.Shaders.Mappings -{ - /// - /// A that contains and maps known HLSL method names to common .NET method - /// - internal static class HlslKnownMethods - { - private static IReadOnlyDictionary? _KnownMethods; - - /// - /// The mapping of supported known methods to HLSL methods - /// - private static IReadOnlyDictionary KnownMethods - { - get - { - if (_KnownMethods != null) return _KnownMethods; - - // Initialize the initial mappings - Dictionary knownMethods = new Dictionary - { - // Math - ["System.Math.Max"] = "max", - ["System.Math.Min"] = "min", - ["System.Math.Pow"] = "pow", - ["System.Math.Sin"] = "sin", - ["System.Math.Sinh"] = "sinh", - ["System.Math.Asin"] = "asin", - ["System.Math.Cos"] = "cos", - ["System.Math.Cosh"] = "cosh", - ["System.Math.Acos"] = "acos", - ["System.Math.Tan"] = "tan", - ["System.Math.Tanh"] = "tanh", - ["System.Math.Atan"] = "atan", - ["System.Math.Atan2"] = "atan2", - ["System.Math.Ceiling"] = "ceil", - ["System.Math.Floor"] = "floor", - ["System.Math.Clamp"] = "clamp", - ["System.Math.Exp"] = "exp", - ["System.Math.Log"] = "log", - ["System.Math.Log10"] = "log10", - ["System.Math.Round"] = "round", - ["System.Math.Sqrt"] = "sqrt", - ["System.Math.Sign"] = "sign", - ["System.Math.Truncate"] = "trunc", - ["System.Math.PI"] = "3.1415926535897931", - - // MathF - ["System.MathF.Max"] = "max", - ["System.MathF.Min"] = "min", - ["System.MathF.Pow"] = "pow", - ["System.MathF.Sin"] = "sin", - ["System.MathF.Sinh"] = "sinh", - ["System.MathF.Asin"] = "asin", - ["System.MathF.Cos"] = "cos", - ["System.MathF.Cosh"] = "cosh", - ["System.MathF.Acos"] = "acos", - ["System.MathF.Tan"] = "tan", - ["System.MathF.Tanh"] = "tanh", - ["System.MathF.Atan"] = "atan", - ["System.MathF.Atan2"] = "atan2", - ["System.MathF.Ceiling"] = "ceil", - ["System.MathF.Floor"] = "floor", - ["System.MathF.Clamp"] = "clamp", - ["System.MathF.Exp"] = "exp", - ["System.MathF.Log"] = "log", - ["System.MathF.Log10"] = "log10", - ["System.MathF.Round"] = "round", - ["System.MathF.Sqrt"] = "sqrt", - ["System.MathF.Sign"] = "sign", - ["System.MathF.Truncate"] = "trunc", - ["System.MathF.PI"] = "3.14159274f", - - // Float - ["float.IsFinite"] = "isfinite", - ["float.IsInfinity"] = "isinf", - ["float.IsNaN"] = "isnan", - - // ThreadIds - ["ComputeSharp.ThreadIds.X"] = ".x", - ["ComputeSharp.ThreadIds.Y"] = ".y", - ["ComputeSharp.ThreadIds.Z"] = ".z", - - // Vector2 - ["System.Numerics.Vector2.X"] = ".x", - ["System.Numerics.Vector2.Y"] = ".y", - ["System.Numerics.Vector2.Dot"] = "dot", - ["System.Numerics.Vector2.Lerp"] = "lerp", - ["System.Numerics.Vector2.Transform"] = "mul", - ["System.Numerics.Vector2.TransformNormal"] = "mul", - ["System.Numerics.Vector2.Normalize"] = "normalize", - ["System.Numerics.Vector2.Zero"] = "(float2)0", - ["System.Numerics.Vector2.One"] = "float2(1.0f, 1.0f)", - ["System.Numerics.Vector2.UnitX"] = "float2(1.0f, 0.0f)", - ["System.Numerics.Vector2.UnitY"] = "float2(0.0f, 1.0f)", - - // Vector3 - ["System.Numerics.Vector3.X"] = ".x", - ["System.Numerics.Vector3.Y"] = ".y", - ["System.Numerics.Vector3.Z"] = ".z", - ["System.Numerics.Vector3.Cross"] = "cross", - ["System.Numerics.Vector3.Dot"] = "dot", - ["System.Numerics.Vector3.Lerp"] = "lerp", - ["System.Numerics.Vector3.Transform"] = "mul", - ["System.Numerics.Vector3.TransformNormal"] = "mul", - ["System.Numerics.Vector3.Normalize"] = "normalize", - ["System.Numerics.Vector3.Zero"] = "(float3)0", - ["System.Numerics.Vector3.One"] = "float3(1.0f, 1.0f, 1.0f)", - ["System.Numerics.Vector3.UnitX"] = "float3(1.0f, 0.0f, 0.0f)", - ["System.Numerics.Vector3.UnitY"] = "float3(0.0f, 1.0f, 0.0f)", - ["System.Numerics.Vector3.UnitZ"] = "float3(0.0f, 0.0f, 1.0f)", - - // Vector4 - ["System.Numerics.Vector4.X"] = ".x", - ["System.Numerics.Vector4.Y"] = ".y", - ["System.Numerics.Vector4.Z"] = ".z", - ["System.Numerics.Vector4.W"] = ".w", - ["System.Numerics.Vector4.Lerp"] = "lerp", - ["System.Numerics.Vector4.Transform"] = "mul", - ["System.Numerics.Vector4.Normalize"] = "normalize", - ["System.Numerics.Vector4.Zero"] = "(float4)0", - ["System.Numerics.Vector4.One"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", - - // Bool2 - ["ComputeSharp.Bool2.False"] = "(bool2)0", - ["ComputeSharp.Bool2.True"] = "bool2(true, true)", - ["ComputeSharp.Bool2.TrueX"] = "bool2(true, false)", - ["ComputeSharp.Bool2.TrueY"] = "bool2(false, true)", - - // Bool3 - ["ComputeSharp.Bool3.False"] = "(bool3)0", - ["ComputeSharp.Bool3.True"] = "bool3(true, true, true)", - ["ComputeSharp.Bool3.TrueX"] = "bool3(true, false, false)", - ["ComputeSharp.Bool3.TrueY"] = "bool3(false, true, false)", - ["ComputeSharp.Bool3.TrueZ"] = "bool3(false, false, true)", - - // Bool4 - ["ComputeSharp.Bool4.False"] = "(bool4)0", - ["ComputeSharp.Bool4.True"] = "bool4(true, true, true, true)", - ["ComputeSharp.Bool4.TrueX"] = "bool4(true, false, false, false)", - ["ComputeSharp.Bool4.TrueY"] = "bool4(false, true, false, false)", - ["ComputeSharp.Bool4.TrueZ"] = "bool4(false, false, true, false)", - ["ComputeSharp.Bool4.TrueW"] = "bool4(false, false, false, true)", - - // Int2 - ["ComputeSharp.Int2.Zero"] = "(int2)0", - ["ComputeSharp.Int2.One"] = "int2(1, 1)", - ["ComputeSharp.Int2.UnitX"] = "int2(1, 0)", - ["ComputeSharp.Int2.UnitY"] = "int2(0, 1)", - - // Int3 - ["ComputeSharp.Int3.Zero"] = "(int3)0", - ["ComputeSharp.Int3.One"] = "int3(1, 1, 1)", - ["ComputeSharp.Int3.UnitX"] = "int3(1, 0, 0)", - ["ComputeSharp.Int3.UnitY"] = "int3(0, 1, 0)", - ["ComputeSharp.Int3.UnitZ"] = "int3(0, 0, 1)", - - // Int4 - ["ComputeSharp.Int4.Zero"] = "(int4)0", - ["ComputeSharp.Int4.One"] = "int4(1, 1, 1, 1)", - ["ComputeSharp.Int4.UnitX"] = "int4(1, 0, 0, 0)", - ["ComputeSharp.Int4.UnitY"] = "int4(0, 1, 0, 0)", - ["ComputeSharp.Int4.UnitZ"] = "int4(0, 0, 1, 0)", - ["ComputeSharp.Int4.UnitW"] = "int4(0, 0, 0, 1)", - - // UInt2 - ["ComputeSharp.UInt2.Zero"] = "(uint2)0", - ["ComputeSharp.UInt2.One"] = "uint2(1u, 1u)", - ["ComputeSharp.UInt2.UnitX"] = "uint2(1u, 0u)", - ["ComputeSharp.UInt2.UnitY"] = "uint2(0u, 1u)", - - // UInt3 - ["ComputeSharp.UInt3.Zero"] = "(uint3)0", - ["ComputeSharp.UInt3.One"] = "uint3(1u, 1u, 1u)", - ["ComputeSharp.UInt3.UnitX"] = "uint3(1u, 0u, 0u)", - ["ComputeSharp.UInt3.UnitY"] = "uint3(0u, 1u, 0u)", - ["ComputeSharp.UInt3.UnitZ"] = "uint3(0u, 0u, 1u)", - - // UInt4 - ["ComputeSharp.UInt4.Zero"] = "(uint4)0", - ["ComputeSharp.UInt4.One"] = "uint4(1u, 1u, 1u, 1u)", - ["ComputeSharp.UInt4.UnitX"] = "uint4(1u, 0u, 0u, 0u)", - ["ComputeSharp.UInt4.UnitY"] = "uint4(0u, 1u, 0u, 0u)", - ["ComputeSharp.UInt4.UnitZ"] = "uint4(0u, 0u, 1u, 0u)", - ["ComputeSharp.UInt4.UnitW"] = "uint4(0u, 0u, 0u, 1u)", - - // Float2 - ["ComputeSharp.Float2.Zero"] = "(float2)0", - ["ComputeSharp.Float2.One"] = "float2(1.0f, 1.0f)", - ["ComputeSharp.Float2.UnitX"] = "float2(1.0f, 0.0f)", - ["ComputeSharp.Float2.UnitY"] = "float2(0.0f, 1.0f)", - - // Float3 - ["ComputeSharp.Float3.Zero"] = "(float3)0", - ["ComputeSharp.Float3.One"] = "float3(1.0f, 1.0f, 1.0f)", - ["ComputeSharp.Float3.UnitX"] = "float3(1.0f, 0.0f, 0.0f)", - ["ComputeSharp.Float3.UnitY"] = "float3(0.0f, 1.0f, 0.0f)", - ["ComputeSharp.Float3.UnitZ"] = "float3(0.0f, 0.0f, 1.0f)", - - // Float4 - ["ComputeSharp.Float4.Zero"] = "(float4)0", - ["ComputeSharp.Float4.One"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", - ["ComputeSharp.Float4.UnitX"] = "float4(1.0f, 0.0f, 0.0f, 0.0f)", - ["ComputeSharp.Float4.UnitY"] = "float4(0.0f, 1.0f, 0.0f, 0.0f)", - ["ComputeSharp.Float4.UnitZ"] = "float4(0.0f, 0.0f, 1.0f, 0.0f)", - ["ComputeSharp.Float4.UnitW"] = "float4(0.0f, 0.0f, 0.0f, 1.0f)", - - // Double2 - ["ComputeSharp.Double2.Zero"] = "(double2)0", - ["ComputeSharp.Double2.One"] = "double2(1.0, 1.0)", - ["ComputeSharp.Double2.UnitX"] = "double2(1.0, 0.0)", - ["ComputeSharp.Double2.UnitY"] = "double2(0.0, 1.0)", - - // Double3 - ["ComputeSharp.Double3.Zero"] = "(double3)0", - ["ComputeSharp.Double3.One"] = "double3(1.0, 1.0, 1.0)", - ["ComputeSharp.Double3.UnitX"] = "double3(1.0, 0.0, 0.0)", - ["ComputeSharp.Double3.UnitY"] = "double3(0.0, 1.0, 0.0)", - ["ComputeSharp.Double3.UnitZ"] = "double3(0.0, 0.0, 1.0)", - - // Double4 - ["ComputeSharp.Double4.Zero"] = "(double4)0", - ["ComputeSharp.Double4.One"] = "double4(1.0, 1.0, 1.0, 1.0)", - ["ComputeSharp.Double4.UnitX"] = "double4(1.0, 0.0, 0.0, 0.0)", - ["ComputeSharp.Double4.UnitY"] = "double4(0.0, 1.0, 0.0, 0.0)", - ["ComputeSharp.Double4.UnitZ"] = "double4(0.0, 0.0, 1.0, 0.0)", - ["ComputeSharp.Double4.UnitW"] = "double4(0.0, 0.0, 0.0, 1.0)" - }; - - // Programmatically load mappings from the Hlsl class as well - foreach (var method in - from method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static) - group method by method.Name - into groups - select (Name: groups.Key, MethodInfo: groups.First())) - { - // Check whether the current method should be translated with the original name - // or with the lowercase version. This is needed because all C# methods are exposed - // with the upper camel case format, while HLSL intrinsics use multiple different formats. - string hlslName = method.MethodInfo.GetCustomAttribute() != null - ? method.Name - : method.Name.ToLowerInvariant(); - - knownMethods.Add($"{typeof(Hlsl).FullName}{Type.Delimiter}{method.Name}", hlslName); - } - - // Programmatically load mappings for the vector types - foreach (var item in - from type in HlslKnownTypes.HlslMappedVectorTypes - from property in type.GetProperties(BindingFlags.Public | BindingFlags.Instance) - select (Type: type, Property: property)) - { - knownMethods.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $".{item.Property.Name.ToLowerInvariant()}"); - } - - return _KnownMethods = knownMethods; - } - } - - /// - /// Tries to get the mapped HLSL-compatible mthod name for the input symbols - /// - /// The containing member symbol for the method to check - /// The symbol for the method to check - /// The mapped name, if one is found - /// The HLSL-compatible method name that can be used in an HLSL shader - [Pure] - public static bool TryGetMappedName(ISymbol containingMemberSymbol, ISymbol memberSymbol, [NotNullWhen(true)] out string? mapped) - { - string fullTypeName = containingMemberSymbol.IsStatic ? containingMemberSymbol.ToString() : memberSymbol.ContainingType.ToString(); - - // Check if the target method is a known method - return KnownMethods.TryGetValue($"{fullTypeName}{Type.Delimiter}{memberSymbol.Name}", out mapped); - } - } -} diff --git a/src/ComputeSharp.Shaders/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.Shaders/Mappings/HlslKnownTypes.cs deleted file mode 100644 index 170953b0..00000000 --- a/src/ComputeSharp.Shaders/Mappings/HlslKnownTypes.cs +++ /dev/null @@ -1,169 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Numerics; -using System.Text.RegularExpressions; - -namespace ComputeSharp.Shaders.Mappings -{ - /// - /// A that contains and maps known HLSL type names to common .NET types - /// - internal static class HlslKnownTypes - { - /// - /// The mapping of supported known types to HLSL types - /// - private static readonly IReadOnlyDictionary KnownTypes = new Dictionary - { - [typeof(bool).FullName] = "bool", - [typeof(Bool).FullName] = "bool", - [typeof(Bool2).FullName] = "bool2", - [typeof(Bool3).FullName] = "bool3", - [typeof(Bool4).FullName] = "bool4", - [typeof(int).FullName] = "int", - [typeof(Int2).FullName] = "int2", - [typeof(Int3).FullName] = "int3", - [typeof(Int4).FullName] = "int4", - [typeof(uint).FullName] = "uint", - [typeof(UInt2).FullName] = "uint2", - [typeof(UInt3).FullName] = "uint3", - [typeof(UInt4).FullName] = "uint4", - [typeof(float).FullName] = "float", - [typeof(Float2).FullName] = "float2", - [typeof(Float3).FullName] = "float3", - [typeof(Float4).FullName] = "float4", - [typeof(Vector2).FullName] = "float2", - [typeof(Vector3).FullName] = "float3", - [typeof(Vector4).FullName] = "float4", - [typeof(double).FullName] = "double", - [typeof(Double2).FullName] = "double2", - [typeof(Double3).FullName] = "double3", - [typeof(Double4).FullName] = "double4", - [typeof(ThreadIds).FullName] = "uint3", - [typeof(ReadOnlyBuffer<>).FullName] = "StructuredBuffer", - [typeof(ReadWriteBuffer<>).FullName] = "RWStructuredBuffer" - }; - - private static HashSet _HlslMappedVectorTypes { get; } = new HashSet(new[] - { - typeof(Bool2), typeof(Bool3), typeof(Bool4), - typeof(Int2), typeof(Int3), typeof(Int4), - typeof(UInt2), typeof(UInt3), typeof(UInt4), - typeof(Float2), typeof(Float3), typeof(Float4), - typeof(Double2), typeof(Double3), typeof(Double4) - }); - - /// - /// Gets the known HLSL vector types available as mapped types - /// - public static IReadOnlyCollection HlslMappedVectorTypes => _HlslMappedVectorTypes; - - /// - /// Checks whether or not the input type is a known HLSL-compatible type - /// - /// The input instance to check - /// A indicating whether the input is in fact a known HLSL type - [Pure] - public static bool IsKnownType(Type type) => IsKnownScalarType(type) || - IsKnownVectorType(type) || - IsConstantBufferType(type) || - IsReadOnlyBufferType(type) || - IsReadWriteBufferType(type); - - /// - /// Checks whether or not the input type is a known scalar type - /// - /// The input instance to check - /// A indicating whether the input is in fact a known HLSL scalar type - [Pure] - public static bool IsKnownScalarType(Type type) => type == typeof(bool) || - type == typeof(Bool) || - type == typeof(int) || - type == typeof(uint) || - type == typeof(float) || - type == typeof(double); - - /// - /// Checks whether or not the input type is a known vector type - /// - /// The input instance to check - /// A indicating whether the input is in fact a known HLSL vector type - [Pure] - public static bool IsKnownVectorType(Type type) => _HlslMappedVectorTypes.Contains(type) || - type == typeof(Vector2) || - type == typeof(Vector3) || - type == typeof(Vector4); - - /// - /// Checks whether or not the input type is a known buffer type - /// - /// The input instance to check - /// A indicating whether the input is in fact a known buffer type - [Pure] - public static bool IsKnownBufferType(Type type) => IsConstantBufferType(type) || - IsReadOnlyBufferType(type) || - IsReadWriteBufferType(type); - - /// - /// Checks whether or not the input type is a value - /// - /// The input instance to check - /// A indicating whether the input is in fact a instance - [Pure] - public static bool IsConstantBufferType(Type type) => type.IsGenericType && - type.GetGenericTypeDefinition() == typeof(ConstantBuffer<>); - - /// - /// Checks whether or not the input type is a value - /// - /// The input instance to check - /// A indicating whether the input is in fact a instance - [Pure] - public static bool IsReadOnlyBufferType(Type type) => type.IsGenericType && - type.GetGenericTypeDefinition() == typeof(ReadOnlyBuffer<>); - - /// - /// Checks whether or not the input type is a value - /// - /// The input instance to check - /// A indicating whether the input is in fact a instance - [Pure] - public static bool IsReadWriteBufferType(Type type) => type.IsGenericType && - type.GetGenericTypeDefinition() == typeof(ReadWriteBuffer<>); - - /// - /// Gets the mapped HLSL-compatible type name for the input instance - /// - /// The input instance to map - /// The HLSL-compatible type name that can be used in an HLSL shader - [Pure] - public static string GetMappedName(Type type) - { - Type declaredType = type.IsArray ? type.GetElementType() : type; - string - fullname = $"{declaredType.Namespace}{Type.Delimiter}{declaredType.Name}", - mappedName = KnownTypes.TryGetValue(fullname, out string mapped) ? mapped : declaredType.Name, - hlslName = declaredType.IsGenericType ? mappedName + $"<{GetMappedName(declaredType.GetGenericArguments()[0])}>" : mappedName; - - return hlslName; - } - - /// - /// Gets the mapped HLSL-compatible type name for the input type name - /// - /// The input type name to map - /// The HLSL-compatible type name that can be used in an HLSL shader - [Pure] - public static string GetMappedName(string name) - { - int indexOfOpenBracket = name.IndexOf('<'); - string - genericArguments = indexOfOpenBracket >= 0 ? name.Substring(indexOfOpenBracket) : string.Empty, - polishedName = indexOfOpenBracket >= 0 ? name.Remove(indexOfOpenBracket) + "`1" : name, - mappedName = KnownTypes.TryGetValue(polishedName, out string mapped) ? mapped : Regex.Match(polishedName, @"[^\.]+$").Value; - - return $"{mappedName}{genericArguments}"; - } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Fields/Abstract/HlslBufferInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Fields/Abstract/HlslBufferInfo.cs deleted file mode 100644 index 85eaee9c..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Fields/Abstract/HlslBufferInfo.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace ComputeSharp.Shaders.Renderer.Models.Fields.Abstract -{ - /// - /// A that contains info on a shader buffer field - /// - internal abstract class HlslBufferInfo : CapturedFieldInfo - { - /// - /// Gets or sets the index of the current buffer, relative to its own type - /// - public int BufferIndex { get; set; } - - /// - /// Creates a new instance with the specified parameters - /// - /// The type of the current field in the C# source - /// The type of the current field in the HLSL shader - /// The name of the current field - /// The index of the current buffer field - protected HlslBufferInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex) : base(fieldCsharpType, fieldHlslType, fieldName) - { - BufferIndex = bufferIndex; - } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Fields/CapturedFieldInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Fields/CapturedFieldInfo.cs deleted file mode 100644 index 091f17d9..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Fields/CapturedFieldInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using ComputeSharp.Graphics.Extensions; -using System; - -namespace ComputeSharp.Shaders.Renderer.Models.Fields -{ - /// - /// A that contains info on a shader field - /// - internal class CapturedFieldInfo - { - /// - /// Gets the type of the current field in the C# source - /// - public string FieldCsharpType { get; } - - /// - /// Gets the type of the current field in the HLSL shader - /// - public string FieldHlslType { get; } - - /// - /// Gets the name to use for the current field - /// - public string FieldName { get; } - - /// - /// Creates a new instance with the specified parameters - /// - /// The type of the current field in the C# source - /// The type of the current field in the HLSL shader - /// The name to use for the current field - public CapturedFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName) - { - FieldCsharpType = fieldCsharpType.ToFriendlyString(); - FieldHlslType = fieldHlslType; - FieldName = fieldName; - } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Fields/ConstantBufferFieldInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Fields/ConstantBufferFieldInfo.cs deleted file mode 100644 index a2554735..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Fields/ConstantBufferFieldInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract; - -namespace ComputeSharp.Shaders.Renderer.Models.Fields -{ - /// - /// A that contains info on a constant buffer field - /// - internal sealed class ConstantBufferFieldInfo : HlslBufferInfo - { - /// - /// Gets whether or not the current instance represents a constant buffer (always ) - /// - public bool IsConstantBuffer { get; } = true; - - /// - /// Creates a new instance with the specified parameters - /// - /// The type of the current field in the C# source - /// The type of the current field in the HLSL shader - /// The name of the current field - /// The index of the current constant buffer field - public ConstantBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex) - : base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex) { } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Fields/ReadOnlyBufferFieldInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Fields/ReadOnlyBufferFieldInfo.cs deleted file mode 100644 index b5ecb59c..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Fields/ReadOnlyBufferFieldInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract; - -namespace ComputeSharp.Shaders.Renderer.Models.Fields -{ - /// - /// A that contains info on a readonly buffer field - /// - internal sealed class ReadOnlyBufferFieldInfo : HlslBufferInfo - { - /// - /// Gets whether or not the current instance represents a readonly buffer (always ) - /// - public bool IsReadOnlyBuffer { get; } = true; - - /// - /// Creates a new instance with the specified parameters - /// - /// The type of the current field in the C# source - /// The type of the current field in the HLSL shader - /// The name of the current field - /// The index of the current readonly buffer field - public ReadOnlyBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex) - : base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex) { } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Fields/ReadWriteBufferFieldInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Fields/ReadWriteBufferFieldInfo.cs deleted file mode 100644 index 86c04a47..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Fields/ReadWriteBufferFieldInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract; - -namespace ComputeSharp.Shaders.Renderer.Models.Fields -{ - /// - /// A that contains info on a read write buffer field - /// - internal sealed class ReadWriteBufferFieldInfo : HlslBufferInfo - { - /// - /// Gets whether or not the current instance represents a read write buffer (always ) - /// - public bool IsReadWriteBuffer { get; } = true; - - /// - /// Creates a new instance with the specified parameters - /// - /// The type of the current field in the C# source - /// The type of the current field in the HLSL shader - /// The name of the current field - /// The index of the current read write buffer field - public ReadWriteBufferFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName, int bufferIndex) - : base(fieldCsharpType, fieldHlslType, fieldName, bufferIndex) { } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Functions/FunctionInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Functions/FunctionInfo.cs deleted file mode 100644 index 9d77fa67..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Functions/FunctionInfo.cs +++ /dev/null @@ -1,75 +0,0 @@ -using ComputeSharp.Graphics.Extensions; -using System; -using System.Collections.Generic; - -namespace ComputeSharp.Shaders.Renderer.Models.Functions -{ - /// - /// A that contains info on a shader function - /// - internal sealed class FunctionInfo - { - /// - /// Gets the return type of the current function in the C# source - /// - public string FunctionCsharpReturnType { get; } - - /// - /// Gets the fullname of the current function in the C# source - /// - public string FunctionFullName { get; } - - /// - /// Gets the parameters of the function in the C# source - /// - public string FunctionCsharpParameters { get; } - - /// - /// Gets the return type of the current function - /// - public string ReturnType { get; } - - /// - /// Gets the name of the current function - /// - public string FunctionName { get; } - - /// - /// Gets the list of parameters for the current function - /// - public IReadOnlyList ParametersList { get; } - - /// - /// Gets the body of the current function - /// - public string FunctionBody { get; } - - /// - /// Creates a new instance with the specified parameters - /// - /// The concrete return type for the function - /// The fullname of the function in the C# source - /// The parameters of the function in the C# source - /// The return type of the current function - /// The name of the current function - /// The function parameters, if any - /// The current function - public FunctionInfo( - Type functionCsharpType, - string functionFullname, - string functionCsharpParameters, - string returnType, - string functionName, - IReadOnlyList parameters, - string functionBody) - { - FunctionCsharpReturnType = functionCsharpType.ToFriendlyString(); - FunctionFullName = functionFullname; - FunctionCsharpParameters = functionCsharpParameters; - ReturnType = returnType; - FunctionName = functionName; - ParametersList = parameters; - FunctionBody = functionBody; - } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Functions/LocalFunctionInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Functions/LocalFunctionInfo.cs deleted file mode 100644 index 4dfd45f9..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Functions/LocalFunctionInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; - -namespace ComputeSharp.Shaders.Renderer.Models.Functions -{ - /// - /// A that contains info on a local shader function - /// - internal sealed class LocalFunctionInfo - { - /// - /// Gets the prototype for the current function - /// - public string FunctionPrototype => FunctionDeclaration.Split(Environment.NewLine)[0]; - - /// - /// Gets the declaration of the current function - /// - public string FunctionDeclaration { get; } - - /// - /// Creates a new instance with the specified parameters - /// - /// The declaration of the current function - public LocalFunctionInfo(string functionDeclaration) - { - FunctionDeclaration = functionDeclaration; - } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Functions/ParameterInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Functions/ParameterInfo.cs deleted file mode 100644 index a424aaf2..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/Functions/ParameterInfo.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; - -namespace ComputeSharp.Shaders.Renderer.Models.Functions -{ - /// - /// A that contains info on a function parameter - /// - internal sealed class ParameterInfo - { - /// - /// Gets the modifier to use for the current parameter - /// - public string ParameterModifier { get; } - - /// - /// Gets the type of the current parameter - /// - public string ParameterType { get; } - - /// - /// Gets the name to use for the current parameter - /// - public string ParameterName { get; } - - /// - /// Gets whether or not the current parameter is the last one for the parent function - /// - public bool IsLastParameter { get; } - - /// - /// Creates a new instance with the specified parameters - /// - /// The modifiers used in the current parameter - /// The type of the current parameter - /// The name of the current parameter - /// Indicates whether or not the current parameter is the last one - public ParameterInfo(IReadOnlyList parameterModifiers, string parameterType, string parameterName, bool last) - { - if (parameterModifiers.Count == 0) ParameterModifier = "in"; - else if (parameterModifiers.First().IsKind(SyntaxKind.OutKeyword)) ParameterModifier = "out"; - else if (parameterModifiers.Any(m => m.IsKind(SyntaxKind.RefKeyword)) && !parameterModifiers.Any(m => m.IsKind(SyntaxKind.ReadOnlyKeyword))) ParameterModifier = "inout"; - else ParameterModifier = "in"; - - ParameterType = parameterType; - ParameterName = parameterName; - IsLastParameter = last; - } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Models/ShaderInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/ShaderInfo.cs deleted file mode 100644 index fd6e92ed..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Models/ShaderInfo.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections.Generic; -using ComputeSharp.Shaders.Renderer.Models.Fields; -using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract; -using ComputeSharp.Shaders.Renderer.Models.Functions; - -#pragma warning disable CS8618 // Non-nullable field is uninitialized - -namespace ComputeSharp.Shaders.Renderer.Models -{ - /// - /// A that contains info to render a shader source to compile - /// - internal sealed class ShaderInfo - { - /// - /// Gets or sets the list of captured buffers being present in the current shader - /// - public IReadOnlyList BuffersList { get; set; } - - /// - /// Gets or sets the list of captured variables being present in the current shader - /// - public IReadOnlyList FieldsList { get; set; } - - /// - /// Gets or sets the number of threads in the X group - /// - public int NumThreadsX { get; set; } - - /// - /// Gets or sets the number of threads in the Y group - /// - public int NumThreadsY { get; set; } - - /// - /// Gets or sets the number of threads in the Z group - /// - public int NumThreadsZ { get; set; } - - /// - /// Gets or sets the name for the threads id variable used in the shader - /// - public string ThreadsIdsVariableName { get; set; } - - /// - /// Gets or sets the shader body to compile - /// - public string ShaderBody { get; set; } - - /// - /// Gets or sets the list of static functions used by the shader - /// - public IReadOnlyList FunctionsList { get; set; } - - /// - /// Gets or sets the list of local (implicit) functions used by the shader - /// - public IReadOnlyList LocalFunctionsList { get; set; } - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/ShaderRenderer.cs b/src/ComputeSharp.Shaders/Renderer/ShaderRenderer.cs deleted file mode 100644 index 8b7339de..00000000 --- a/src/ComputeSharp.Shaders/Renderer/ShaderRenderer.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Diagnostics.Contracts; -using System.IO; -using System.Linq; -using System.Reflection; -using ComputeSharp.Shaders.Renderer.Models; -using Stubble.Core; - -namespace ComputeSharp.Shaders.Renderer -{ - /// - /// A that uses the mustache templating system to render HLSL shaders - /// - internal sealed class ShaderRenderer - { - /// - /// Gets the singleton instance to use - /// - public static ShaderRenderer Instance { get; } = new ShaderRenderer(); - - /// - /// Creates a new instance and loads the mustache template to use - /// - private ShaderRenderer() - { - Assembly assembly = Assembly.GetExecutingAssembly(); - string filename = assembly.GetManifestResourceNames().First(name => name.EndsWith("ShaderTemplate.mustache")); - - using Stream stream = assembly.GetManifestResourceStream(filename); - using StreamReader reader = new StreamReader(stream); - - Template = reader.ReadToEnd(); - } - - /// - /// Gets the mustache template used by the shader renderer - /// - public string Template { get; } - - /// - /// Renders a new HLSL shader source with the given parameters - /// - /// The input instance with the shader information - /// The source code for the new HLSL shader - [Pure] - public string Render(ShaderInfo info) => StaticStubbleRenderer.Render(Template, info); - } -} diff --git a/src/ComputeSharp.Shaders/Renderer/Templates/ShaderTemplate.mustache b/src/ComputeSharp.Shaders/Renderer/Templates/ShaderTemplate.mustache deleted file mode 100644 index 62515497..00000000 --- a/src/ComputeSharp.Shaders/Renderer/Templates/ShaderTemplate.mustache +++ /dev/null @@ -1,65 +0,0 @@ -/* =============== - * AUTO GENERATED - * =============== - * This shader was created by ComputeSharp. - * For info or issues: https://github.com/Sergio0694/ComputeSharp */ - -{{!Captured variables buffer}} -// Scalar/vector variables -cbuffer _ : register(b0) -{ - uint __x__; // Target X iterations - uint __y__; // Target Y iterations - uint __z__; // Target Z iterations -{{#FieldsList}} - {{&FieldHlslType}} {{FieldName}}; -{{/FieldsList}} -} -{{#BuffersList}} -{{#IsConstantBuffer}} - -{{!Constant buffer}} -// {{&FieldCsharpType}} buffer "{{FieldName}}" -cbuffer _{{FieldName}} : register(b{{BufferIndex}}) -{ - {{&FieldHlslType}} {{FieldName}}[2]; -} -{{/IsConstantBuffer}} -{{#IsReadOnlyBuffer}} - -{{!Readonly buffer}} -// {{&FieldCsharpType}} buffer "{{FieldName}}" -{{&FieldHlslType}} {{FieldName}} : register(t{{BufferIndex}}); -{{/IsReadOnlyBuffer}} -{{#IsReadWriteBuffer}} - -{{!Read write buffer}} -// {{&FieldCsharpType}} buffer "{{FieldName}}" -{{&FieldHlslType}} {{FieldName}} : register(u{{BufferIndex}}); -{{/IsReadWriteBuffer}} -{{/BuffersList}} -{{#FunctionsList}} - -{{!Shader private functions}} -// {{FunctionCsharpReturnType}} {{&FunctionFullName}}({{FunctionCsharpParameters}}) -{{ReturnType}} {{FunctionName}}({{#ParametersList}}{{ParameterModifier}} {{ParameterType}} {{ParameterName}}{{^IsLastParameter}}, {{/IsLastParameter}}{{/ParametersList}}) -{{FunctionBody}} -{{/FunctionsList}} -{{#LocalFunctionsList}} - -{{!Shader implicit functions}} -// {{FunctionPrototype}} -{{FunctionDeclaration}} -{{/LocalFunctionsList}} - -{{!Shader entry point}} -// Shader body -[Shader("compute")] -[NumThreads({{NumThreadsX}}, {{NumThreadsY}}, {{NumThreadsZ}})] -void CSMain(uint3 {{ThreadsIdsVariableName}} : SV_DispatchThreadId) -{ - if ({{ThreadsIdsVariableName}}.x < __x__ && - {{ThreadsIdsVariableName}}.y < __y__ && - {{ThreadsIdsVariableName}}.z < __z__) // Automatic bounds check -{{&ShaderBody}} -} diff --git a/src/ComputeSharp.Shaders/ShaderRunner{T}.cs b/src/ComputeSharp.Shaders/ShaderRunner{T}.cs deleted file mode 100644 index e60f27db..00000000 --- a/src/ComputeSharp.Shaders/ShaderRunner{T}.cs +++ /dev/null @@ -1,198 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; -using ComputeSharp.Graphics; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Shaders.Renderer; -using ComputeSharp.Shaders.Renderer.Models; -using ComputeSharp.Shaders.Translation; -using ComputeSharp.Shaders.Translation.Models; -using Vortice.Direct3D12; -using CommandList = ComputeSharp.Graphics.Commands.CommandList; -using PipelineState = ComputeSharp.Graphics.Commands.PipelineState; - -namespace ComputeSharp.Shaders -{ - /// - /// A with helper methods to support . - /// This type is primarily needed to avoid having fields being repeated per generic instantiation. - /// - internal static class ShaderRunner - { - /// - /// A thread-safe map of reusable GPU buffers for captured locals - /// - [ThreadStatic] - private static ConditionalWeakTable>? variablesBuffers; - - /// - /// Gets the reusable instance for a shader invocation - /// - /// The to use to run the shader - /// The reusable instance to populate - [Pure] - public static ConstantBuffer GetVariablesBuffer(GraphicsDevice device) - { - var map = variablesBuffers ??= new ConditionalWeakTable>(); - - return map.GetValue(device, gpu => new ConstantBuffer(gpu, 4096)); - } - } - - /// - /// A responsible for performing all the necessary operations to compile and run a compute shader - /// - /// The type of compute shader to run - internal static class ShaderRunner - where T : struct, IComputeShader - { - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters - /// - /// The to use to run the shader - /// The number of iterations to run on the X axis - /// The number of iterations to run on the Y axis - /// The number of iterations to run on the Z axis - /// The input instance representing the compute shader to run - public static void Run(GraphicsDevice device, int x, int y, int z, in T shader) - { - // Calculate the optimized thread num values - int threadsX, threadsY = 1, threadsZ = 1; - if (y == 1 && z == 1) threadsX = device.WavefrontSize; - else if (z == 1) threadsX = threadsY = 8; - else threadsX = threadsY = threadsZ = 4; - - Run(device, x, y, z, threadsX, threadsY, threadsZ, shader); - } - - /// - /// The mapping used to cache and reuse compiled shaders - /// - private static readonly Dictionary> ShadersCache = new Dictionary>(); - - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters - /// - /// The to use to run the shader - /// The number of iterations to run on the X axis - /// The number of iterations to run on the Y axis - /// The number of iterations to run on the Z axis - /// The number of threads in each thread group for the X axis - /// The number of threads in each thread group for the Y axis - /// The number of threads in each thread group for the Z axis - /// The input instance representing the compute shader to run - public static void Run( - GraphicsDevice device, - int x, int y, int z, - int threadsX, int threadsY, int threadsZ, - in T shader) - { - // Create the shader key - ShaderKey key = new ShaderKey(ShaderHashCodeProvider.GetHashCode(shader), threadsX, threadsY, threadsZ); - CachedShader shaderData; - PipelineState pipelineState; - - lock (ShadersCache) - { - // Get or preload the shader - if (!ShadersCache.TryGetValue(key, out shaderData)) - { - LoadShader(threadsX, threadsY, threadsZ, shader, out shaderData); - - // Cache for later use - ShadersCache.Add(key, shaderData); - } - - // Create the reusable pipeline state - if (!shaderData.CachedPipelines.TryGetValue(device, out pipelineState)) - { - CreatePipelineState(device, shaderData, out pipelineState); - } - } - - // Create the commands list and set the pipeline state - using CommandList commandList = new CommandList(device, CommandListType.Compute); - commandList.SetPipelineState(pipelineState); - - // Extract the dispatch data for the shader invocation - using DispatchData dispatchData = shaderData.Loader.GetDispatchData(shader, x, y, z); - - // Load the captured buffers - Span resources = dispatchData.Resources; - for (int i = 0; i < resources.Length; i++) - { - commandList.SetComputeRootDescriptorTable(i + 1, resources[i]); - } - - // Initialize the loop targets and the captured values - ConstantBuffer variablesBuffer = ShaderRunner.GetVariablesBuffer(device); - variablesBuffer.SetData(dispatchData.Variables); - commandList.SetComputeRootDescriptorTable(0, variablesBuffer); - - // Calculate the dispatch values - int - groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1), - groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1), - groupsZ = Math.DivRem(z, threadsZ, out int modZ) + (modZ == 0 ? 0 : 1); - - // Dispatch and wait for completion - commandList.Dispatch(groupsX, groupsY, groupsZ); - commandList.ExecuteAndWaitForCompletion(); - } - - /// - /// Loads a shader with the specified parameters - /// - /// The number of threads in each thread group for the X axis - /// The number of threads in each thread group for the Y axis - /// The number of threads in each thread group for the Z axis - /// The input instance representing the compute shader to run - /// The instance to return with the cached shader data - [MethodImpl(MethodImplOptions.NoInlining)] - private static void LoadShader(int threadsX, int threadsY, int threadsZ, in T shader, out CachedShader shaderData) - { - // Load the input shader - ShaderLoader shaderLoader = ShaderLoader.Load(shader); - - // Render the loaded shader - string shaderSource = ShaderRenderer.Instance.Render(new ShaderInfo - { - BuffersList = shaderLoader.BuffersList, - FieldsList = shaderLoader.FieldsList, - NumThreadsX = threadsX, - NumThreadsY = threadsY, - NumThreadsZ = threadsZ, - ThreadsIdsVariableName = shaderLoader.ThreadsIdsVariableName, - ShaderBody = shaderLoader.MethodBody, - FunctionsList = shaderLoader.FunctionsList, - LocalFunctionsList = shaderLoader.LocalFunctionsList - }); - - // Compile the loaded shader to HLSL bytecode - ShaderBytecode shaderBytecode = ShaderCompiler.CompileShader(shaderSource); - - // Get the cached shader data - shaderData = new CachedShader(shaderLoader, shaderBytecode); - } - - /// - /// Creates and caches a instance for a given shader - /// - /// The to use to run the shader - /// The instance with the data on the loaded shader - /// The resulting instance to use to run the shader - [MethodImpl(MethodImplOptions.NoInlining)] - private static void CreatePipelineState(GraphicsDevice device, in CachedShader shaderData, out PipelineState pipelineState) - { - // Create the root signature for the pipeline and get the pipeline state - RootSignatureDescription1 rootSignatureDescription = new RootSignatureDescription1(RootSignatureFlags.None, shaderData.Loader.RootParameters); - VersionedRootSignatureDescription versionedRootSignatureDescription = new VersionedRootSignatureDescription(rootSignatureDescription); - ID3D12RootSignature rootSignature = device.CreateRootSignature(versionedRootSignatureDescription); - pipelineState = new PipelineState(device, rootSignature, shaderData.Bytecode); - - // Cache the pipeline state for the target device - shaderData.CachedPipelines.Add(device, pipelineState); - } - } -} diff --git a/src/ComputeSharp.Shaders/Translation/Enums/MethodType.cs b/src/ComputeSharp.Shaders/Translation/Enums/MethodType.cs deleted file mode 100644 index c3c188e8..00000000 --- a/src/ComputeSharp.Shaders/Translation/Enums/MethodType.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace ComputeSharp.Shaders.Translation.Enums -{ - /// - /// An that indicates a type of method to decompile - /// - internal enum MethodType - { - /// - /// The instance method on some shader type - /// - Execute, - - /// - /// A standalone, static method - /// - Static - } -} diff --git a/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs b/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs deleted file mode 100644 index abf4038c..00000000 --- a/src/ComputeSharp.Shaders/Translation/MethodDecompiler.cs +++ /dev/null @@ -1,257 +0,0 @@ -using System; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Reflection.Metadata; -using System.Text.RegularExpressions; -using ComputeSharp.Shaders.Mappings; -using ComputeSharp.Shaders.Translation.Enums; -using ICSharpCode.Decompiler; -using ICSharpCode.Decompiler.CSharp; -using ICSharpCode.Decompiler.Metadata; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace ComputeSharp.Shaders.Translation -{ - /// - /// A that is able to decompile arbitrary methods - /// - internal sealed class MethodDecompiler - { - /// - /// Gets the singleton instance to use - /// - public static MethodDecompiler Instance { get; } = new MethodDecompiler(); - - /// - /// The mapping of available instances targeting different assemblies - /// - private readonly Dictionary Decompilers = new Dictionary(); - - /// - /// The incremental instance for the shader assembly - /// - private Compilation _Compilation; - - /// - /// Creates a new instance - /// - private MethodDecompiler() - { - // Load the assembly paths for all the available dlls - IReadOnlyList assemblyPaths; - if (!string.IsNullOrEmpty(Assembly.GetEntryAssembly()?.Location)) - { - assemblyPaths = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic).Select(a => a.Location).ToArray(); - } - else - { - assemblyPaths = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.dll").Where(p => - { - try - { - using PEFile _ = new PEFile(p); - return true; - } - catch - { - return false; - } - }).ToArray(); - } - - // Ceate an incremental shader assembly with the available references - IEnumerable metadataReferences = assemblyPaths.Select(p => MetadataReference.CreateFromFile(p)); - _Compilation = CSharpCompilation.Create("ShaderAssembly").WithReferences(metadataReferences); - - // Monitor for new assemblies being loaded - AppDomain.CurrentDomain.AssemblyLoad += CurrentDomain_AssemblyLoad; - } - - // Increment the shader assembly when a new assembly is loaded - private void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs e) - { - if (!e.LoadedAssembly.IsDynamic) - { - PortableExecutableReference metadataReference = MetadataReference.CreateFromFile(e.LoadedAssembly.Location); - _Compilation = _Compilation.AddReferences(metadataReference); - } - } - - /// - /// Creates a new instance targeting a given assembly - /// - /// The path of the assembly to decompile - /// A instance that can be used on the targeted assembly - [Pure] - private static CSharpDecompiler CreateDecompiler(string assemblyPath) - { - DecompilerSettings decompilerSettings = new DecompilerSettings(ICSharpCode.Decompiler.CSharp.LanguageVersion.Latest) - { - ObjectOrCollectionInitializers = false, - UsingDeclarations = false, - CSharpFormattingOptions = { IndentationString = IndentedTextWriter.DefaultTabString } - }; - - UniversalAssemblyResolver resolver = new UniversalAssemblyResolver(assemblyPath, false, "netstandard"); - return new CSharpDecompiler(assemblyPath, resolver, decompilerSettings); - } - - /// - /// Decompiles a method or the whole declaring type - /// - /// The target to decompile - /// Specifies whether or not to force the decompilation of just the given method, even if not static - /// The decompiled source code - [Pure] - private string DecompileMethodOrDeclaringType(MethodInfo methodInfo, bool methodOnly = false) - { - // Get the handle of the containing type method - string assemblyPath = methodInfo.DeclaringType?.Assembly.Location ?? throw new InvalidOperationException(); - int metadataToken = methodInfo.IsStatic || methodOnly ? methodInfo.MetadataToken : methodInfo.DeclaringType.MetadataToken; - EntityHandle typeHandle = MetadataTokenHelpers.TryAsEntityHandle(metadataToken) ?? throw new InvalidOperationException(); - - // Get or create a decompiler for the target assembly, and decompile the type - if (!Decompilers.TryGetValue(assemblyPath, out CSharpDecompiler decompiler)) - { - decompiler = CreateDecompiler(assemblyPath); - Decompilers.Add(assemblyPath, decompiler); - } - - return decompiler.DecompileAsString(typeHandle); - } - - /// - /// Decompiles a target method and returns its and info - /// - /// The input to inspect - /// The type of method to decompile - /// The root node for the syntax tree of the input method - /// The semantic model for the input method - public void GetSyntaxTree(MethodInfo methodInfo, MethodType methodType, out MethodDeclarationSyntax rootNode, out SemanticModel semanticModel) - { - string sourceCode = methodType switch - { - MethodType.Execute => GetSyntaxTreeForExecuteMethod(methodInfo), - MethodType.Static => GetSyntaxTreeForStaticMethod(methodInfo), - _ => throw new ArgumentOutOfRangeException(nameof(methodType), $"Invalid method type: {methodType}") - }; - - // Load the type syntax tree - SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(sourceCode); - - // Get the root node to return - rootNode = syntaxTree - .GetRoot() - .DescendantNodes() - .OfType() - .First(node => node.Identifier.ToString().Equals(methodInfo.Name) || - node.GetLeadingTrivia().ToFullString().Contains(methodInfo.Name)); - - // Update the incremental compilation and retrieve the syntax tree for the method - Compilation compilation = _Compilation.AddSyntaxTrees(syntaxTree); - semanticModel = compilation.GetSemanticModel(syntaxTree); - } - - /// - /// Decompiles a target closure method - /// - /// The input to inspect - [Pure] - private string GetSyntaxTreeForExecuteMethod(MethodInfo methodInfo) - { - // Decompile the method source - string sourceCode = DecompileMethodOrDeclaringType(methodInfo); - - // Remove the in keyword from the source - string inFixedSourceCode = Regex.Replace(sourceCode, @"(? - /// Decompiles a target method and returns its and info - /// - /// The input to inspect - [Pure] - private string GetSyntaxTreeForStaticMethod(MethodInfo methodInfo) - { - string - sourceCode = DecompileMethodOrDeclaringType(methodInfo, true), - methodFixedCode = sourceCode.Replace(methodInfo.Name, Regex.Replace(methodInfo.Name, "[<>|]", "_")), - methodWithoutAttributes = CSharpSyntaxTree - .ParseText(methodFixedCode) - .GetRoot() - .DescendantNodes() - .OfType() - .First() - .WithAttributeLists(default) - .ToString(), - prototype = methodWithoutAttributes.Split(Environment.NewLine)[0], - commentedSourceCode = $"// {methodInfo.Name}{Environment.NewLine}{methodWithoutAttributes}", - inFixedSourceCode = Regex.Replace(commentedSourceCode, @"(?().First(); - - return $"// {methodInfo.Name}{Environment.NewLine}{prototype}{Environment.NewLine}{block.ToFullString()}"; - } - - /// - /// Refactors all the inline out expressions with a variable declaration - /// - /// The input source code to process - /// The name of the shader method being processed - [Pure] - private string RefactorInlineOutDeclarations(string source, string entryPoint) - { - // Replace the discards - source = Regex.Replace(source, @"(? $"out {m.Groups[1].Value} {new string(Guid.NewGuid().ToByteArray().Select(b => (char)('a' + b % 26)).ToArray())}"); - - // Fix invalid C# names with @ prefix - source = Regex.Replace(source, @"@(\w+)", m => $"__at__{m.Groups[1].Value}"); - - // Load the syntax tree and the entry node - SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); - MethodDeclarationSyntax rootNode = syntaxTree - .GetRoot() - .DescendantNodes() - .OfType() - .First(node => node.Identifier.ToString().Equals(entryPoint) || - node.GetLeadingTrivia().ToFullString().Contains(entryPoint)); - - // Get the out declarations to replace - var outs = ( - from argument in rootNode.DescendantNodes().OfType() - where argument.RefKindKeyword.IsKind(SyntaxKind.OutKeyword) && - argument.Expression.IsKind(SyntaxKind.DeclarationExpression) - let match = Regex.Match(argument.Expression.ToFullString(), @"([\w.]+) ([\w_]+)") - let mappedType = HlslKnownTypes.GetMappedName(match.Groups[1].Value) - let declaration = $"{mappedType} {match.Groups[2].Value} = ({mappedType})0;" - select declaration).ToArray(); - - // Insert the explicit declarations at the start of the method - int start = rootNode.Body.ChildNodes().First().SpanStart; - foreach (var declaration in outs.Reverse()) - { - source = source.Insert(start, $"{declaration}{Environment.NewLine} "); - } - - // Remove the out keyword from the source - source = Regex.Replace(source, @"(? - /// A that contains all the captured data to dispatch a shader - /// - internal readonly ref struct DispatchData - { - /// - /// The array with the captured buffers - /// - private readonly GraphicsResource[] ResourcesArray; - - /// - /// The number of instances in - /// - private readonly int ResourcesCount; - - /// - /// The array with all the captured variables, with proper padding - /// - private readonly byte[] VariablesArray; - - /// - /// The actual size in bytes to use from - /// - private readonly int VariablesByteSize; - - /// - /// Creates a new instance with the specified parameters - /// - /// The array with the captured buffers - /// The number of instances in - /// The array with all the captured variables, with proper padding - /// The actual size in bytes to use from - public DispatchData(GraphicsResource[] resourcesArray, int resourcesCount, byte[] variablesArray, int variablesByteSize) - { - ResourcesArray = resourcesArray; - VariablesArray = variablesArray; - ResourcesCount = resourcesCount; - VariablesByteSize = variablesByteSize; - } - - /// - /// Gets a with all the captured buffers - /// - public Span Resources - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => ResourcesArray.AsSpan(0, ResourcesCount); - } - - /// - /// Gets a with the padded data representing all the captured variables - /// - public Span Variables - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ref Int4 r = ref Unsafe.As(ref VariablesArray[0]); - bool mod = (VariablesByteSize & 15) > 0; - int length = VariablesByteSize / 4 + Unsafe.As(ref mod); - return MemoryMarshal.CreateSpan(ref r, length); - } - } - - /// - /// Implements the method and returns the rented buffers - /// - public void Dispose() - { - ArrayPool.Shared.Return(ResourcesArray, true); - ArrayPool.Shared.Return(VariablesArray); - } - } -} diff --git a/src/ComputeSharp.Shaders/Translation/Models/ReadableMember.cs b/src/ComputeSharp.Shaders/Translation/Models/ReadableMember.cs deleted file mode 100644 index d20dd74e..00000000 --- a/src/ComputeSharp.Shaders/Translation/Models/ReadableMember.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Reflection; - -namespace ComputeSharp.Shaders.Translation.Models -{ - /// - /// A that wraps a readable member of another and provides access to it - /// - internal sealed class ReadableMember - { - /// - /// The object wrapped by the current instance - /// - private readonly MemberInfo Member; - - /// - /// Creates a new instance with the given parameters - /// - /// The target object wrapped by the current instance - private ReadableMember(MemberInfo memberInfo) - { - // General properties - Member = memberInfo; - Name = memberInfo.Name; - DeclaringType = memberInfo.DeclaringType; - - // Type specific properties - if (memberInfo is FieldInfo fieldInfo) - { - Member = fieldInfo; - IsStatic = fieldInfo.IsStatic; - MemberType = fieldInfo.FieldType; - } - else if (memberInfo is PropertyInfo propertyInfo) - { - Member = propertyInfo; - IsStatic = propertyInfo.GetMethod.IsStatic; - MemberType = propertyInfo.PropertyType; - } - else throw new InvalidOperationException("Field and property can't both be null at the same time"); - } - - /// - /// Gets the name of the wrapped member for the current instance - /// - public string Name { get; } - - /// - /// Gets whether or not the current member is not an instance member - /// - public bool IsStatic { get; } - - /// - /// Gets the where the current member is declared in - /// - public Type DeclaringType { get; } - - /// - /// Gets the of the wrapped member for the current instance - /// - public Type MemberType { get; } - - /// - /// Gets or sets the list of parent members to access the current one from the root instance - /// - public IReadOnlyList? Parents { get; set; } - - /// - /// Returns the value of the wrapped member for the current instance - /// - /// The target instance to use to read the value from - [Pure] - public object GetValue(object? instance) - { - return Member switch - { - FieldInfo field => field.GetValue(instance), - PropertyInfo property => property.GetValue(instance), - _ => throw new InvalidOperationException("Field and property can't both be null at the same time") - }; - } - - /// - /// Converts a object into a instance - /// - /// The input object to wrap - public static implicit operator ReadableMember(FieldInfo field) => new ReadableMember(field); - - /// - /// Converts a object into a instance - /// - /// The input object to wrap - public static implicit operator ReadableMember(PropertyInfo property) => new ReadableMember(property); - - /// - /// Converts a object into a instance - /// - /// The input object to unwrap - public static implicit operator MemberInfo(ReadableMember member) => member.Member; - - /// - /// Converts a object into a instance - /// - /// The input object to unwrap - public static implicit operator FieldInfo(ReadableMember member) => (FieldInfo)member.Member; - - /// - /// Converts a object into a instance - /// - /// The input object to unwrap - public static implicit operator PropertyInfo(ReadableMember member) => (PropertyInfo)member.Member; - } -} diff --git a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs b/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs deleted file mode 100644 index f7f45eab..00000000 --- a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Diagnostics.Contracts; -using ComputeSharp.Exceptions; -using Vortice.Direct3D12; -using Vortice.Dxc; - -namespace ComputeSharp.Shaders.Translation -{ - /// - /// A that uses the APIs to compile compute shaders - /// - internal static class ShaderCompiler - { - /// - /// The instance to use to create the bytecode for HLSL sources - /// - private static readonly IDxcLibrary Library = Dxc.CreateDxcLibrary(); - - /// - /// Compiles a new HLSL shader from the input source code - /// - /// The HLSL source code to compile - /// The bytecode for the compiled shader - [Pure] - public static ShaderBytecode CompileShader(string source) - { - var result = DxcCompiler.Compile(DxcShaderStage.ComputeShader, source, "CSMain", string.Empty, new DxcCompilerOptions { ShaderModel = DxcShaderModel.Model6_1 }); - - // Get the compiled bytecode in case of success - if (result.GetStatus() == 0) - { - IDxcBlob blob = result.GetResult(); - byte[] bytecode = Dxc.GetBytesFromBlob(blob); - - return bytecode; - } - - // Compile error - string resultText = Dxc.GetStringFromBlob(Library, result.GetErrors()); - throw new HlslCompilationException(resultText); - } - } -} diff --git a/src/ComputeSharp.Shaders/Translation/ShaderHashCodeProvider.cs b/src/ComputeSharp.Shaders/Translation/ShaderHashCodeProvider.cs deleted file mode 100644 index c0421fde..00000000 --- a/src/ComputeSharp.Shaders/Translation/ShaderHashCodeProvider.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Linq; -using System.Reflection; -using System.Reflection.Emit; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Shaders.Translation -{ - /// - /// A that handles the cache system for the generated shaders - /// - internal static class ShaderHashCodeProvider - { - /// - /// A type containing static info for a given shader type - /// - /// The type of compute shader currently in use - private static class TypeInfo - where T : struct, IComputeShader - { - /// - /// The id of the compute shader type in use - /// - public static readonly int Id; - - /// - /// The optional instance, if needed - /// - public static readonly Hasher? Hasher; - - /// - /// Initializes the static members of the type - /// - static TypeInfo() - { - Id = HashCode.Combine(typeof(T)); - - // Get the valid delegates for delegate checking - FieldInfo[] delegateFieldInfos = ( - from fieldInfo in typeof(T).GetFields() - where fieldInfo.FieldType.IsDelegate() - select fieldInfo).ToArray(); - - // If at least one delegate is present, build the hasher method - if (delegateFieldInfos.Length > 0) - { - Hasher = BuildDynamicHasher(delegateFieldInfos); - } - } - } - - /// - /// Gets a unique hashcode for the input compute shader instance - /// - /// The type of compute shader currently in use - /// The input instance representing the shader to run - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static int GetHashCode(in T shader) - where T : struct, IComputeShader - { - int hash = TypeInfo.Id; - - Hasher? hasher = TypeInfo.Hasher; - - if (hasher != null) hash = hasher(hash, shader); - - return hash; - } - - /// - /// A that represents an aggregate hash function for a given instance - /// - /// The type of compute shader currently in use - /// The initial hash value - /// The compute shader instance to use to compute the final hash value - /// The final hash value for the input closure - private delegate int Hasher(int hash, in T shader) - where T : struct, IComputeShader; - - /// - /// Builds a new instance for the target and sequence of values - /// - /// The type of compute shader currently in use - /// The list of captured fields to inspect - [Pure] - private static Hasher BuildDynamicHasher(IReadOnlyCollection fieldInfos) - where T : struct, IComputeShader - { - return DynamicMethod>.New(il => - { - MethodInfo - getMethodInfo = typeof(Delegate).GetProperty(nameof(Delegate.Method)).GetMethod, - getHashCodeInfo = typeof(object).GetMethod(nameof(object.GetHashCode)); - foreach (FieldInfo fieldInfo in fieldInfos) - { - // (hashcode << 5) + hashcode - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Ldc_I4_5); - il.Emit(OpCodes.Shl); - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Add); - - // hashcode += shader.Function[#].Method.GetHashCode(); - il.Emit(OpCodes.Ldarg_1); - il.Emit(OpCodes.Ldfld, fieldInfo); - il.EmitCall(OpCodes.Callvirt, getMethodInfo, null); - il.EmitCall(OpCodes.Callvirt, getHashCodeInfo, null); - il.Emit(OpCodes.Add); - il.Emit(OpCodes.Starg_S, (byte)0); - } - - // Return the computed hash - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Ret); - }); - } - } -} diff --git a/src/ComputeSharp.Shaders/Translation/ShaderLoader{T}.IL.cs b/src/ComputeSharp.Shaders/Translation/ShaderLoader{T}.IL.cs deleted file mode 100644 index 24814bdf..00000000 --- a/src/ComputeSharp.Shaders/Translation/ShaderLoader{T}.IL.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.Buffers; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Reflection.Emit; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Graphics.Buffers.Abstract; -using ComputeSharp.Shaders.Mappings; -using ComputeSharp.Shaders.Translation.Models; - -namespace ComputeSharp.Shaders.Translation -{ - /// - internal sealed partial class ShaderLoader - { - /// - /// The number of captured graphics resources (buffers) - /// - private int _ResourcesCount; - - /// - /// The size in bytes of the buffer with the captured variables - /// - private int _VariablesByteSize = 3 * sizeof(int); // X, Y and Z threads count - - // The cached loader method - private DispatchDataLoader? _DispatchDataLoader; - - /// - /// The of instances mapping the captured variables in the current shader - /// - private readonly List _CapturedMembers = new List(); - - /// - /// A that loads all the captured members from a shader instance - /// - /// The shader instance to load the data from - /// A reference to the buffer with all the captured instances - /// A reference to the buffer to use to store all the captured value types - private delegate void DispatchDataLoader(in T shader, ref GraphicsResource r0, ref byte r1); - - /// - /// Gets a new instance with all the captured data for the current shader instance - /// - /// The input instance representing the compute shader to run - /// The number of iterations to run on the X axis - /// The number of iterations to run on the Y axis - /// The number of iterations to run on the Z axis - [Pure] - public DispatchData GetDispatchData(in T shader, int x, int y, int z) - { - // Resources and variables buffers - GraphicsResource[] resources = ArrayPool.Shared.Rent(_ResourcesCount); - byte[] variables = ArrayPool.Shared.Rent(_VariablesByteSize); - ref GraphicsResource r0 = ref resources[0]; - ref byte r1 = ref variables[0]; - - // Set the x, y and z counters - Unsafe.As(ref r1) = x; - Unsafe.Add(ref Unsafe.As(ref r1), 1) = y; - Unsafe.Add(ref Unsafe.As(ref r1), 2) = z; - - // Invoke the dynamic method to extract the captured data - _DispatchDataLoader!(shader, ref r0, ref r1); - - return new DispatchData(resources, _ResourcesCount, variables, _VariablesByteSize); - } - - /// - /// Builds a new instance that loads the dispatch data for the current shader type - /// - private void BuildDispatchDataLoader() - { - _DispatchDataLoader = DynamicMethod.New(il => - { - foreach (ReadableMember member in _CapturedMembers) - { - if (HlslKnownTypes.IsKnownBufferType(member.MemberType)) - { - // Load the offset address into the resource buffers - il.Emit(OpCodes.Ldarg_1); - if (_ResourcesCount > 0) il.EmitAddOffset(_ResourcesCount); - _ResourcesCount++; - } - else if (HlslKnownTypes.IsKnownScalarType(member.MemberType) || HlslKnownTypes.IsKnownVectorType(member.MemberType)) - { - // Calculate the right offset with 16-bytes padding (HLSL constant buffer) - int size = member.MemberType == typeof(bool) ? sizeof(uint) : Marshal.SizeOf(member.MemberType); // bool is 4 bytes in HLSL - if (_VariablesByteSize % 16 > 16 - size) _VariablesByteSize += 16 - _VariablesByteSize % 16; - - // Load the target address into the variables buffer - il.Emit(OpCodes.Ldarg_2); - il.EmitAddOffset(_VariablesByteSize); - _VariablesByteSize += size; - } - else throw new InvalidOperationException($"Invalid captured member of type {member.MemberType}"); - - // Load the reference to the input delegate if the member is not static - if (!member.IsStatic) il.Emit(OpCodes.Ldarg_0); - - // Read the current member and store it to the target address - il.EmitReadMember(member); - il.EmitStoreToAddress(member.MemberType); - } - - il.Emit(OpCodes.Ret); - }); - } - } -} diff --git a/src/ComputeSharp.Shaders/Translation/ShaderLoader{T}.cs b/src/ComputeSharp.Shaders/Translation/ShaderLoader{T}.cs deleted file mode 100644 index 0541da9a..00000000 --- a/src/ComputeSharp.Shaders/Translation/ShaderLoader{T}.cs +++ /dev/null @@ -1,310 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.Contracts; -using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; -using ComputeSharp.Graphics.Extensions; -using ComputeSharp.Shaders.Mappings; -using ComputeSharp.Shaders.Renderer.Models.Fields; -using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract; -using ComputeSharp.Shaders.Renderer.Models.Functions; -using ComputeSharp.Shaders.Translation.Enums; -using ComputeSharp.Shaders.Translation.Models; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Vortice.Direct3D12; -using ParameterInfo = ComputeSharp.Shaders.Renderer.Models.Functions.ParameterInfo; - -#pragma warning disable CS8618 // Non-nullable field is uninitialized - -namespace ComputeSharp.Shaders.Translation -{ - /// - /// A responsible for loading and processing shaders of a given type - /// - /// The type of compute shader currently in use - internal sealed partial class ShaderLoader - where T : struct, IComputeShader - { - /// - /// Creates a new instance - /// - private ShaderLoader() { } - - /// - /// The number of constant buffers to define in the shader - /// - private int _ConstantBuffersCount; - - /// - /// The number of readonly buffers to define in the shader - /// - private int _ReadOnlyBuffersCount; - - /// - /// The number of read write buffers to define in the shader - /// - private int _ReadWriteBuffersCount; - - /// - /// The of items that are required to load the captured values - /// - private readonly List DescriptorRanges = new List(); - - private RootParameter1[]? _RootParameters; - - /// - /// Gets the array for the current shader - /// - public RootParameter1[] RootParameters => _RootParameters ??= DescriptorRanges.Select(range => new RootParameter1(new RootDescriptorTable1(range), ShaderVisibility.All)).ToArray(); - - private readonly List _BuffersList = new List(); - - /// - /// Gets the collection of items for the shader fields - /// - public IReadOnlyList BuffersList => _BuffersList; - - private readonly List _FieldsList = new List(); - - /// - /// Gets the collection of items for the shader fields - /// - public IReadOnlyList FieldsList => _FieldsList; - - /// - /// Gets the name of the variable used as input for the shader method - /// - public string ThreadsIdsVariableName { get; private set; } - - /// - /// Gets the generated source code for the method in the current shader - /// - public string MethodBody { get; private set; } - - private readonly List _FunctionsList = new List(); - - /// - /// Gets the collection of items for the shader - /// - public IReadOnlyList FunctionsList => _FunctionsList; - - private readonly List _LocalFunctionsList = new List(); - - /// - /// Gets the collection of items for the shader - /// - public IReadOnlyList LocalFunctionsList => _LocalFunctionsList; - - /// - /// Loads and processes an input shadeer - /// - /// The instance to use to build the shader - /// A new instance representing the input shader - [Pure] - public static ShaderLoader Load(in T shader) - { - ShaderLoader @this = new ShaderLoader(); - - /* Reading members through reflection requires an object parameter, - * so here we're just boxing the input shader once to avoid allocating - * it multiple times in the managed heap while processing the shader. */ - object box = shader; - - @this.LoadFieldsInfo(box); - @this.LoadMethodSource(box); - @this.BuildDispatchDataLoader(); - - return @this; - } - - /// - /// Loads the fields info for the current shader being loaded - /// - /// The boxed instance to use to build the shader - private void LoadFieldsInfo(object shader) - { - IReadOnlyList shaderFields = typeof(T).GetFields( - BindingFlags.Instance | - BindingFlags.Static | - BindingFlags.Public | - BindingFlags.NonPublic).ToArray(); - - if (shaderFields.Count == 0) throw new InvalidOperationException("Empty shader body"); - - // Descriptor for the buffer for captured scalar/vector variables - DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.ConstantBufferView, 1, _ConstantBuffersCount++)); - - // Inspect the captured fields - foreach (FieldInfo fieldInfo in shaderFields) - { - LoadFieldInfo(shader, fieldInfo); - } - } - - /// - /// Loads a specified and adds it to the shader model - /// - /// The boxed instance to use to build the shader - /// The target to load - /// The optional explicit name to use for the field - private void LoadFieldInfo(object shader, ReadableMember memberInfo, string? name = null) - { - Type fieldType = memberInfo.MemberType; - string fieldName = HlslKnownKeywords.GetMappedName(name ?? memberInfo.Name); - - // Constant buffer - if (HlslKnownTypes.IsConstantBufferType(fieldType)) - { - DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.ConstantBufferView, 1, _ConstantBuffersCount)); - - _CapturedMembers.Add(memberInfo); - - string typeName = HlslKnownTypes.GetMappedName(fieldType.GenericTypeArguments[0]); - _BuffersList.Add(new ConstantBufferFieldInfo(fieldType, typeName, fieldName, _ConstantBuffersCount++)); - } - else if (HlslKnownTypes.IsReadOnlyBufferType(fieldType)) - { - // Root parameter for a readonly buffer - DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.ShaderResourceView, 1, _ReadOnlyBuffersCount)); - - _CapturedMembers.Add(memberInfo); - - string typeName = HlslKnownTypes.GetMappedName(fieldType); - _BuffersList.Add(new ReadOnlyBufferFieldInfo(fieldType, typeName, fieldName, _ReadOnlyBuffersCount++)); - } - else if (HlslKnownTypes.IsReadWriteBufferType(fieldType)) - { - // Root parameter for a read write buffer - DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.UnorderedAccessView, 1, _ReadWriteBuffersCount)); - - _CapturedMembers.Add(memberInfo); - - string typeName = HlslKnownTypes.GetMappedName(fieldType); - _BuffersList.Add(new ReadWriteBufferFieldInfo(fieldType, typeName, fieldName, _ReadWriteBuffersCount++)); - } - else if (HlslKnownTypes.IsKnownScalarType(fieldType) || HlslKnownTypes.IsKnownVectorType(fieldType)) - { - _CapturedMembers.Add(memberInfo); - - string typeName = HlslKnownTypes.GetMappedName(fieldType); - _FieldsList.Add(new CapturedFieldInfo(fieldType, typeName, fieldName)); - } - else if (fieldType.IsDelegate() && - memberInfo.GetValue(shader) is Delegate func && - (func.Method.IsStatic || func.Method.DeclaringType.IsStatelessDelegateContainer()) && - (HlslKnownTypes.IsKnownScalarType(func.Method.ReturnType) || HlslKnownTypes.IsKnownVectorType(func.Method.ReturnType)) && - fieldType.GenericTypeArguments.All(type => HlslKnownTypes.IsKnownScalarType(type) || - HlslKnownTypes.IsKnownVectorType(type))) - { - // Captured static delegates with a return type - LoadStaticMethodSource(shader, fieldName, func.Method); - } - else throw new ArgumentException($"Invalid captured variable of type {fieldType} with name \"{memberInfo.Name}\""); - } - - /// - /// Loads the entry method for the current shader being loaded - /// - /// The boxed instance to use to build the shader - private void LoadMethodSource(object shader) - { - // Decompile the shader method - MethodInfo methodInfo = typeof(T).GetMethod(nameof(IComputeShader.Execute)); - MethodDecompiler.Instance.GetSyntaxTree(methodInfo, MethodType.Execute, out MethodDeclarationSyntax root, out SemanticModel semanticModel); - - // Rewrite the shader method (eg. to fix the type declarations) - ShaderSyntaxRewriter syntaxRewriter = new ShaderSyntaxRewriter(semanticModel, typeof(T)); - root = (MethodDeclarationSyntax)syntaxRewriter.Visit(root); - - // Extract the implicit local functions - var locals = root.DescendantNodes().OfType().ToArray(); - root = root.RemoveNodes(locals, SyntaxRemoveOptions.KeepNoTrivia); - foreach (var local in locals) - { - string alignedLocal = local.ToFullString().RemoveLeftPadding().Trim(' ', '\r', '\n'); - alignedLocal = Regex.Replace(alignedLocal, @"(?<=\W)(\d+)[fFdD]", m => m.Groups[1].Value); - alignedLocal = HlslKnownKeywords.GetMappedText(alignedLocal); - - _LocalFunctionsList.Add(new LocalFunctionInfo(alignedLocal)); - } - - // Register the captured static members - foreach (var member in syntaxRewriter.StaticMembers) - { - LoadFieldInfo(shader, member.Value, member.Key); - } - - // Register the captured static methods - foreach (var method in syntaxRewriter.StaticMethods) - { - LoadStaticMethodSource(shader, method.Key, method.Value); - } - - // Get the thread ids identifier name and shader method body - ThreadsIdsVariableName = root.ParameterList.Parameters.First().Identifier.Text; - MethodBody = root.Body!.ToFullString(); - - // Additional preprocessing - MethodBody = Regex.Replace(MethodBody, @"(?<=\W)(\d+)[fFdD]", m => m.Groups[1].Value); - MethodBody = MethodBody.TrimEnd('\n', '\r', ' '); - MethodBody = HlslKnownKeywords.GetMappedText(MethodBody); - } - - /// - /// Loads additional static methods used by the shader - /// - /// The boxed instance to use to build the shader - /// The HLSL name of the new method to load - /// The instance for the method to load - private void LoadStaticMethodSource(object shader, string name, MethodInfo methodInfo) - { - // Decompile the target method - MethodDecompiler.Instance.GetSyntaxTree(methodInfo, MethodType.Static, out MethodDeclarationSyntax root, out SemanticModel semanticModel); - - // Rewrite the method - ShaderSyntaxRewriter syntaxRewriter = new ShaderSyntaxRewriter(semanticModel, methodInfo.DeclaringType); - root = (MethodDeclarationSyntax)syntaxRewriter.Visit(root); - - // Register the captured static members - foreach (var member in syntaxRewriter.StaticMembers) - { - LoadFieldInfo(shader, member.Value, member.Key); - } - - // Register the captured static methods - foreach (var method in syntaxRewriter.StaticMethods) - { - LoadStaticMethodSource(shader, method.Key, method.Value); - } - - // Get the function parameters - IReadOnlyList parameters = ( - from parameter in root.ParameterList.Parameters.Select((p, i) => (Node: p, Index: i)) - let modifiers = parameter.Node.Modifiers - let type = parameter.Node.Type!.ToFullString() - let parameterName = parameter.Node.Identifier.ToFullString() - let last = parameter.Index == root.ParameterList.Parameters.Count - 1 - select new ParameterInfo(modifiers, type, parameterName, last)).ToArray(); - - // Get the function body - string body = root.Body!.ToFullString(); - body = Regex.Replace(body, @"(?<=\W)(\d+)[fFdD]", m => m.Groups[1].Value); - body = body.TrimEnd('\n', '\r', ' '); - body = HlslKnownKeywords.GetMappedText(body); - - // Get the final function info instance - FunctionInfo functionInfo = new FunctionInfo( - methodInfo.ReturnType, - $"{methodInfo.DeclaringType.FullName}{Type.Delimiter}{methodInfo.Name}", - string.Join(", ", methodInfo.GetParameters().Select(p => $"{p.ParameterType.ToFriendlyString()} {p.Name}")), - root.ReturnType.ToString(), - name, - parameters, - body); - - _FunctionsList.Add(functionInfo); - } - } -} diff --git a/src/ComputeSharp.Shaders/Translation/ShaderSyntaxRewriter.cs b/src/ComputeSharp.Shaders/Translation/ShaderSyntaxRewriter.cs deleted file mode 100644 index 37d1f584..00000000 --- a/src/ComputeSharp.Shaders/Translation/ShaderSyntaxRewriter.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using ComputeSharp.Shaders.Translation.Models; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace ComputeSharp.Shaders.Translation -{ - /// - /// A custom that processes C# methods to convert to HLSL - /// - internal class ShaderSyntaxRewriter : CSharpSyntaxRewriter - { - /// - /// The instance to use to rewrite the decompiled code - /// - private readonly SemanticModel SemanticModel; - - /// - /// The declaring type that hosts the root from which the current syntax tree is inspected - /// - private readonly Type DeclaringType; - - /// - /// Creates a new instance with the specified parameters - /// - /// The instance to use to rewrite the decompiled code - /// The declaring type that hosts the root from which the current syntax tree is inspected - public ShaderSyntaxRewriter(SemanticModel semanticModel, Type declaringType) - { - SemanticModel = semanticModel; - DeclaringType = declaringType; - } - - private readonly Dictionary _StaticMembers = new Dictionary(); - - /// - /// Gets the mapping of captured static members used by the target code - /// - public IReadOnlyDictionary StaticMembers => _StaticMembers; - - private readonly Dictionary _StaticMethods = new Dictionary(); - - /// - /// Gets the mapping of captured static methods used by the target code - /// - public IReadOnlyDictionary StaticMethods => _StaticMethods; - - /// - public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node) - { - node = (IdentifierNameSyntax)base.VisitIdentifierName(node); - node = node.ReplaceIdentifierName(DeclaringType, out var variable); - - // Register the captured member, if any - if (variable.HasValue && !_StaticMembers.ContainsKey(variable.Value.Name)) - { - _StaticMembers.Add(variable.Value.Name, variable.Value.MemberInfo); - } - - return node; - } - - /// - public override SyntaxNode VisitParameter(ParameterSyntax node) - { - node = (ParameterSyntax)base.VisitParameter(node); - node = node.WithAttributeLists(default); - node = node.ReplaceType(node.Type); - - return node; - } - - /// - public override SyntaxNode VisitArgument(ArgumentSyntax node) - { - node = (ArgumentSyntax)base.VisitArgument(node); - - if (node.RefKindKeyword.IsKind(SyntaxKind.RefKeyword)) - { - node = node.WithRefKindKeyword(SyntaxFactory.Token(SyntaxKind.None)); - } - - return node; - } - - /// - public override SyntaxNode VisitCastExpression(CastExpressionSyntax node) - { - node = (CastExpressionSyntax)base.VisitCastExpression(node); - - return node.ReplaceType(node.Type); - } - - /// - public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node) - { - node = (LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node); - - return node.ReplaceType(node.Declaration.Type); - } - - /// - public override SyntaxNode VisitObjectCreationExpression(ObjectCreationExpressionSyntax node) - { - node = (ObjectCreationExpressionSyntax)base.VisitObjectCreationExpression(node); - node = node.ReplaceType(node.Type); - - if (node.ArgumentList.Arguments.Count == 0) - { - return SyntaxFactory.CastExpression(node.Type, SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(0))); - } - - return SyntaxFactory.InvocationExpression(node.Type, node.ArgumentList); - } - - /// - public override SyntaxNode VisitDefaultExpression(DefaultExpressionSyntax node) - { - node = (DefaultExpressionSyntax)base.VisitDefaultExpression(node); - node = node.ReplaceType(node.Type); - - return SyntaxFactory.CastExpression(node.Type, SyntaxFactory.LiteralExpression(SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(0))); - } - - /// - public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node) - { - node = (MemberAccessExpressionSyntax)base.VisitMemberAccessExpression(node); - SyntaxNode syntaxNode = node.ReplaceMember(SemanticModel, out var variable, out var method); - - // Register the captured members, if any - if (variable.HasValue && !_StaticMembers.ContainsKey(variable.Value.Name)) - { - _StaticMembers.Add(variable.Value.Name, variable.Value.MemberInfo); - } - if (method.HasValue && !_StaticMethods.ContainsKey(method.Value.Name)) - { - _StaticMethods.Add(method.Value.Name, method.Value.MethodInfo); - } - - return syntaxNode; - } - - /// - public override SyntaxNode VisitInvocationExpression(InvocationExpressionSyntax node) - { - node = (InvocationExpressionSyntax)base.VisitInvocationExpression(node); - node = node.ReplaceInvocation(DeclaringType, out var variable, out var method); - - // Register the captured members, if any - if (variable.HasValue && !_StaticMembers.ContainsKey(variable.Value.Name)) - { - _StaticMembers.Add(variable.Value.Name, variable.Value.MemberInfo); - } - if (method.HasValue && !_StaticMethods.ContainsKey(method.Value.Name)) - { - _StaticMethods.Add(method.Value.Name, method.Value.MethodInfo); - } - - return node; - } - - /// - public override SyntaxNode VisitMethodDeclaration(MethodDeclarationSyntax node) - { - node = (MethodDeclarationSyntax)base.VisitMethodDeclaration(node); - - // Replace the return type node, if needed - if (!node.ReturnType.ToString().Equals("void")) - { - return node.ReplaceType(node.ReturnType); - } - - return node; - } - } -} diff --git a/src/ComputeSharp.SourceGenerators/AnalyzerReleases.Shipped.md b/src/ComputeSharp.SourceGenerators/AnalyzerReleases.Shipped.md new file mode 100644 index 00000000..054a5960 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/AnalyzerReleases.Shipped.md @@ -0,0 +1,2 @@ +; Shipped analyzer releases +; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md \ No newline at end of file diff --git a/src/ComputeSharp.SourceGenerators/AnalyzerReleases.Unshipped.md b/src/ComputeSharp.SourceGenerators/AnalyzerReleases.Unshipped.md new file mode 100644 index 00000000..dad27523 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/AnalyzerReleases.Unshipped.md @@ -0,0 +1,49 @@ +; Unshipped analyzer release +; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md + +### New Rules + +Rule ID | Category | Severity | Notes +--------|----------|----------|------- +CMPS0001 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0002 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0003 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0004 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0005 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0006 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0007 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0008 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0009 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0010 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0011 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0012 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0013 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0014 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0015 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0016 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0017 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0018 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0019 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0020 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0021 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0022 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0023 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0024 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0025 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0026 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0027 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0028 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0029 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0030 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0031 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0032 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0033 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0034 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0035 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0036 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0037 | ComputeSharp.SourceGenerators.AutoConstructorGenerator | Warning | AutoConstructorGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0038 | ComputeSharp.SourceGenerators.IComputeShaderDataLoaderGenerator | Warning | IComputeShaderDataLoaderGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0039 | ComputeSharp.SourceGenerators.IComputeShaderHashCodeGenerator | Warning | IComputeShaderHashCodeGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0040 | ComputeSharp.SourceGenerators.IComputeShaderSourceGenerator | Warning | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0041 | ComputeSharp.SourceGenerators.ShaderMethodSourceGenerator | Warning | ShaderMethodSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) +CMPS0042 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp) \ No newline at end of file diff --git a/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.cs b/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.cs new file mode 100644 index 00000000..463b416b --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/AutoConstructorGenerator.cs @@ -0,0 +1,115 @@ +using System.Collections.Immutable; +using System.Linq; +using System.Text; +using ComputeSharp.SourceGenerators.Diagnostics; +using ComputeSharp.SourceGenerators.Extensions; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; +using static Microsoft.CodeAnalysis.SymbolDisplayTypeQualificationStyle; + +namespace ComputeSharp.SourceGenerators +{ + [Generator] + public class AutoConstructorGenerator : ISourceGenerator + { + /// + public void Initialize(GeneratorInitializationContext context) + { + } + + /// + public void Execute(GeneratorExecutionContext context) + { + // Find all the [AutoConstructor] usages + ImmutableArray attributes = ( + from tree in context.Compilation.SyntaxTrees + from attribute in tree.GetRoot().DescendantNodes().OfType() + let symbol = context.Compilation.GetSemanticModel(attribute.SyntaxTree) + let typeInfo = symbol.GetTypeInfo(attribute) + where typeInfo.Type is { Name: nameof(AutoConstructorAttribute) } + select attribute).ToImmutableArray(); + + foreach (AttributeSyntax attribute in attributes) + { + StructDeclarationSyntax structDeclaration = attribute.FirstAncestorOrSelf()!; + SemanticModel semanticModel = context.Compilation.GetSemanticModel(structDeclaration.SyntaxTree); + INamedTypeSymbol structDeclarationSymbol = semanticModel.GetDeclaredSymbol(structDeclaration)!; + + try + { + OnExecute(context, structDeclaration, structDeclarationSymbol); + } + catch + { + context.ReportDiagnostic(AutoConstructorGeneratorError, attribute, structDeclarationSymbol); + } + } + } + + /// + /// Processes a given target type. + /// + /// The input instance to use. + /// The node to process. + /// The for . + private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol) + { + // Extract the info on the type to process + var namespaceName = structDeclarationSymbol.ContainingNamespace.ToDisplayString(new(typeQualificationStyle: NameAndContainingTypesAndNamespaces)); + var structName = structDeclaration.Identifier.Text; + var structModifiers = structDeclaration.Modifiers; + var fields = ( + from fieldSymbol in structDeclarationSymbol.GetMembers().OfType() + where !fieldSymbol.IsConst && !fieldSymbol.IsStatic + let typeName = fieldSymbol.Type!.ToDisplayString() + let fieldFullType = ParseTypeName(typeName) + select (Type: fieldFullType, Identifier: Identifier(fieldSymbol.Name))).ToImmutableArray(); + + // Create the constructor declaration for the type. This will + // produce a constructor with simple initialization of all variables: + // + // public MyType(Foo a, Bar b, Baz c, ...) + // { + // this.a = a; + // this.b = b; + // this.c = c; + // ... + // } + var structDeclarationSyntax = + StructDeclaration(structName).WithModifiers(structModifiers).AddMembers( + ConstructorDeclaration(structName) + .AddModifiers(Token(SyntaxKind.PublicKeyword)) + .AddParameterListParameters(fields.Select(field => Parameter(field.Identifier).WithType(field.Type)).ToArray()) + .AddBodyStatements(fields.Select(field => ParseStatement($"this.{field.Identifier} = {field.Identifier};")).ToArray())); + + TypeDeclarationSyntax typeDeclarationSyntax = structDeclarationSyntax; + + // Add all parent types in ascending order, if any + foreach (var parentType in structDeclaration.Ancestors().OfType()) + { + typeDeclarationSyntax = parentType + .WithMembers(SingletonList(typeDeclarationSyntax)) + .WithConstraintClauses(List()) + .WithBaseList(null) + .WithAttributeLists(List()) + .WithoutTrivia(); + } + + // Create the compilation unit with the namespace and target member. + // From this, we can finally generate the source code to output. + var source = + CompilationUnit().AddMembers( + NamespaceDeclaration(IdentifierName(namespaceName)).AddMembers(typeDeclarationSyntax)) + .NormalizeWhitespace() + .ToFullString(); + + // Add the partial type + context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } + } +} + diff --git a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj new file mode 100644 index 00000000..1caa0d0e --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj @@ -0,0 +1,76 @@ + + + + netstandard2.0 + analyzers\dotnet\cs + false + ComputeSharp.SourceGenerators + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs new file mode 100644 index 00000000..e7e12598 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs @@ -0,0 +1,604 @@ +using Microsoft.CodeAnalysis; + +namespace ComputeSharp.SourceGenerators.Diagnostics +{ + /// + /// A container for all instances for errors reported by analyzers in this project. + /// + internal static class DiagnosticDescriptors + { + /// + /// Gets a for an invalid shader field. + /// + /// Format: "The compute shader of type {0} contains a field \"{1}\" of an invalid type {2}". + /// + /// + public static readonly DiagnosticDescriptor InvalidShaderField = new( + id: "CMPS0001", + title: "Invalid shader field", + messageFormat: "The compute shader of type {0} contains a field \"{1}\" of an invalid type {2}", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A type representing a compute shader contains a field of a type that is not supported in HLSL.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid group shared field type. + /// + /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2}". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupSharedFieldType = new( + id: "CMPS0002", + title: "Invalid group shared field type", + messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2} (it must be an array)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A group shared field must be of an array type.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid group shared field element type. + /// + /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid element type {2}". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupSharedFieldElementType = new( + id: "CMPS0003", + title: "Invalid group shared field element type", + messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" of an invalid type {2} (it must be a primitive or unmanaged type)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A group shared field element must be of a primitive or unmanaged type.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid group shared field declaration. + /// + /// Format: "The compute shader of type {0} contains a group shared field \"{1}\" that is not static". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupSharedFieldDeclaration = new( + id: "CMPS0004", + title: "Invalid group shared field declaration", + messageFormat: "The compute shader of type {0} contains a group shared field \"{1}\" that is not static", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A group shared field must be static.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a shader with no resources. + /// + /// Format: "The compute shader of type {0} contains no resources to work on". + /// + /// + public static readonly DiagnosticDescriptor MissingShaderResources = new( + id: "CMPS0005", + title: "Missing shader resources", + messageFormat: "The compute shader of type {0} contains no resources to work on", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader must contain at least one resource.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid usage. + /// + /// Format: "The ThreadIds type is used in method {0} of type {1}". + /// + /// + public static readonly DiagnosticDescriptor InvalidThreadIdsUsage = new( + id: "CMPS0006", + title: "Invalid ThreadIds usage", + messageFormat: "The ThreadIds type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The ThreadIds type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid usage. + /// + /// Format: "The GroupIds type is used in method {0} of type {1}". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupIdsUsage = new( + id: "CMPS0007", + title: "Invalid GroupIds usage", + messageFormat: "The GroupIds type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The GroupIds type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid usage. + /// + /// Format: "The GroupSize type is used in method {0} of type {1}". + /// + /// + public static readonly DiagnosticDescriptor InvalidGroupSizeUsage = new( + id: "CMPS0008", + title: "Invalid GroupSize usage", + messageFormat: "The GroupSize type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The GroupSize type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid usage. + /// + /// Format: "The WarpIds type is used in method {0} of type {1}". + /// + /// + public static readonly DiagnosticDescriptor InvalidWarpIdsUsage = new( + id: "CMPS0009", + title: "Invalid WarpIds usage", + messageFormat: "The WarpIds type can only be used within the main body of a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The WarpIds type can only be used within the main body of a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid object creation expression. + /// + /// Format: "The type {0} cannot be created in a compute shader". + /// + /// + public static readonly DiagnosticDescriptor InvalidObjectCreationExpression = new( + id: "CMPS0010", + title: "Invalid object creation expression", + messageFormat: "The type {0} cannot be created in a compute shader (only unmanaged types are supported)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Only unmanaged value type objects can be created in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an anonymous object creation expression. + /// + public static readonly DiagnosticDescriptor AnonymousObjectCreationExpression = new( + id: "CMPS0011", + title: "Anonymous object creation expression", + messageFormat: "An anonymous object cannot be created in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "An anonymous object cannot be created in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an async modifier on a method or function. + /// + public static readonly DiagnosticDescriptor AsyncModifierOnMethodOrFunction = new( + id: "CMPS0012", + title: "Async modifier on method or function", + messageFormat: "The async modifier cannot be used in methods or functions used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The async modifier cannot be used in methods or functions used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an await expression. + /// + public static readonly DiagnosticDescriptor AwaitExpression = new( + id: "CMPS0013", + title: "Await expression", + messageFormat: "The await expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The await expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a checked expression. + /// + public static readonly DiagnosticDescriptor CheckedExpression = new( + id: "CMPS0014", + title: "Checked expression", + messageFormat: "A checked expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A checked expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a checked statement. + /// + public static readonly DiagnosticDescriptor CheckedStatement = new( + id: "CMPS0015", + title: "Checked statement", + messageFormat: "A checked statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A checked statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a fixed statement. + /// + public static readonly DiagnosticDescriptor FixedStatement = new( + id: "CMPS0016", + title: "Fixed statement", + messageFormat: "A fixed statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A fixed statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a foreach statement. + /// + public static readonly DiagnosticDescriptor ForEachStatement = new( + id: "CMPS0017", + title: "Foreach statement", + messageFormat: "A foreach statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A foreach statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a lock statement. + /// + public static readonly DiagnosticDescriptor LockStatement = new( + id: "CMPS0018", + title: "Foreach statement", + messageFormat: "A lock statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A lock statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a query statement. + /// + public static readonly DiagnosticDescriptor QueryExpression = new( + id: "CMPS0019", + title: "Foreach statement", + messageFormat: "A LINQ query expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A LINQ query expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a range expression. + /// + public static readonly DiagnosticDescriptor RangeExpression = new( + id: "CMPS0020", + title: "Range expression", + messageFormat: "A range expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A range expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a recursive pattern. + /// + public static readonly DiagnosticDescriptor RecursivePattern = new( + id: "CMPS0021", + title: "Recursive pattern", + messageFormat: "A recursive pattern cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A recursive pattern cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a ref type. + /// + public static readonly DiagnosticDescriptor RefType = new( + id: "CMPS0022", + title: "Ref type", + messageFormat: "A compute shader cannot have a ref type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a ref type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a relational pattern. + /// + public static readonly DiagnosticDescriptor RelationalPattern = new( + id: "CMPS0023", + title: "Relational pattern", + messageFormat: "A relational pattern cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A relational pattern cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a sizeof expression. + /// + public static readonly DiagnosticDescriptor SizeOfExpression = new( + id: "CMPS0024", + title: "Sizeof expression", + messageFormat: "A sizeof expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A sizeof expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a stackalloc expression. + /// + public static readonly DiagnosticDescriptor StackAllocArrayCreationExpression = new( + id: "CMPS0025", + title: "Stackalloc expression", + messageFormat: "A stackalloc expression cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A stackalloc expression cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a throw expression or statement. + /// + public static readonly DiagnosticDescriptor ThrowExpressionOrStatement = new( + id: "CMPS0026", + title: "Throw expression or statement", + messageFormat: "Throw expressions and statements cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Throw expressions and statements cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a try statement. + /// + public static readonly DiagnosticDescriptor TryStatement = new( + id: "CMPS0027", + title: "Try statement", + messageFormat: "A try statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A try statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a tuple type. + /// + public static readonly DiagnosticDescriptor TupleType = new( + id: "CMPS0028", + title: "Tuple type", + messageFormat: "A compute shader cannot have a tuple type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a tuple type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a using statement or declaration. + /// + public static readonly DiagnosticDescriptor UsingStatementOrDeclaration = new( + id: "CMPS0029", + title: "Using statement or declaration", + messageFormat: "Using statements and declarations cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Using statements and declarations cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a yield statement. + /// + public static readonly DiagnosticDescriptor YieldStatement = new( + id: "CMPS0030", + title: "Yield statement", + messageFormat: "A yield statement cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A yield statement cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an invalid object declaration. + /// + /// Format: "A variable of type {0} cannot be declared in a compute shader". + /// + /// + public static readonly DiagnosticDescriptor InvalidObjectDeclaration = new( + id: "CMPS0031", + title: "Invalid object declaration", + messageFormat: "A variable of type {0} cannot be declared in a compute shader (only unmanaged types are supported)", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "Only unmanaged value type objects can be declared in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a pointer type. + /// + public static readonly DiagnosticDescriptor PointerType = new( + id: "CMPS0032", + title: "Pointer type", + messageFormat: "A compute shader cannot have a pointer type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a pointer type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a function pointer type. + /// + public static readonly DiagnosticDescriptor FunctionPointer = new( + id: "CMPS0033", + title: "Function pointer type", + messageFormat: "A compute shader cannot have a function pointer type declaration", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have a function pointer type declaration.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an unsafe statement. + /// + public static readonly DiagnosticDescriptor UnsafeStatement = new( + id: "CMPS0034", + title: "Unsafe statement", + messageFormat: "A compute shader cannot have an unsafe statement", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "A compute shader cannot have an unsafe statement.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an unsafe modifier on a method or function. + /// + public static readonly DiagnosticDescriptor UnsafeModifierOnMethodOrFunction = new( + id: "CMPS0035", + title: "Unsafe modifier on method or function", + messageFormat: "The unsafe modifier cannot be used in methods or functions used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The unsafe modifier cannot be used in methods or functions used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for a string literal. + /// + public static readonly DiagnosticDescriptor StringLiteralExpression = new( + id: "CMPS0036", + title: "String literal expression", + messageFormat: "String literal expressions cannot be used in a compute shader", + category: typeof(IComputeShader).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "String literal expressions cannot be used in a compute shader.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator AutoConstructorGenerator failed to execute on type {0}, and its constructor might not be available". + /// + /// + public static readonly DiagnosticDescriptor AutoConstructorGeneratorError = new( + id: "CMPS0037", + title: $"Internal error for {nameof(AutoConstructorGenerator)}", + messageFormat: $"The generator {nameof(AutoConstructorGenerator)} failed to execute on type {{0}}, and its constructor might not be available", + category: typeof(AutoConstructorGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(AutoConstructorGenerator)} generator encountered an error while processing a type, and its constructor might not be available. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator IComputeShaderDataLoaderGenerator failed to execute on type {0}, and trying to use that shader might result in a runtime crash". + /// + /// + public static readonly DiagnosticDescriptor IComputeShaderDataLoaderGeneratorError = new( + id: "CMPS0038", + title: $"Internal error for {nameof(IComputeShaderDataLoaderGenerator)}", + messageFormat: $"The generator {nameof(IComputeShaderDataLoaderGenerator)} failed to execute on type {{0}}, and trying to use that shader might result in a runtime crash", + category: typeof(IComputeShaderDataLoaderGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(IComputeShaderDataLoaderGenerator)} generator encountered an error while processing a type, and trying to use that shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator IComputeShaderHashCodeGenerator failed to execute on type {0}, and trying to use that shader might result in a runtime crash". + /// + /// + public static readonly DiagnosticDescriptor IComputeShaderHashCodeGeneratorError = new( + id: "CMPS0039", + title: $"Internal error for {nameof(IComputeShaderHashCodeGenerator)}", + messageFormat: $"The generator {nameof(IComputeShaderHashCodeGenerator)} failed to execute on type {{0}}, and trying to use that shader might result in a runtime crash", + category: typeof(IComputeShaderHashCodeGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(IComputeShaderHashCodeGenerator)} generator encountered an error while processing a type, and trying to use that shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator IComputeShaderSourceGenerator failed to execute on type {0}, and trying to use that shader might result in a runtime crash". + /// + /// + public static readonly DiagnosticDescriptor IComputeShaderSourceGeneratorError = new( + id: "CMPS0040", + title: $"Internal error for {nameof(IComputeShaderSourceGenerator)}", + messageFormat: $"The generator {nameof(IComputeShaderSourceGenerator)} failed to execute on type {{0}}, and trying to use that shader might result in a runtime crash", + category: typeof(IComputeShaderSourceGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(IComputeShaderSourceGenerator)} generator encountered an error while processing a type, and trying to use that shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an internal error in . + /// + /// Format: "The generator ShaderMethodSourceGenerator failed to execute on method {0}, and using it in a shader might result in a runtime crash". + /// + /// + public static readonly DiagnosticDescriptor ShaderMethodSourceGeneratorError = new( + id: "CMPS0041", + title: $"Internal error for {nameof(ShaderMethodSourceGenerator)}", + messageFormat: $"The generator {nameof(ShaderMethodSourceGenerator)} failed to execute on method {{0}}, and using it in a shader might result in a runtime crash", + category: typeof(ShaderMethodSourceGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Warning, + isEnabledByDefault: true, + description: $"The {nameof(ShaderMethodSourceGenerator)} generator encountered an error while processing a method, and using it in a shader might result in a runtime crash. Please report this issue at https://github.com/Sergio0694/ComputeSharp/issues.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + + /// + /// Gets a for an incorrect matrix swizzling property argument. + /// + public static readonly DiagnosticDescriptor NonConstantMatrixSwizzledIndex = new( + id: "CMPS0042", + title: "Non constant matrix swizzled property argument", + messageFormat: "The arguments in a swizzled indexer for a matrix type must be compile-time constants", + category: typeof(ShaderMethodSourceGenerator).FullName, + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + description: "The arguments in a swizzled indexer for a matrix type must be compile-time constants.", + helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); + } +} diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs new file mode 100644 index 00000000..e9509100 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs @@ -0,0 +1,43 @@ +using System.Linq; +using Microsoft.CodeAnalysis; + +namespace ComputeSharp.SourceGenerators.Diagnostics +{ + /// + /// Extension methods for , specifically for reporting diagnostics. + /// + internal static class DiagnosticsExtensions + { + /// + /// Adds a new diagnostics to the current compilation. + /// + /// The instance currently in use. + /// The input for the diagnostics to create. + /// The source to attach the diagnostics to. + /// The optional arguments for the formatted message to include. + public static void ReportDiagnostic( + this GeneratorExecutionContext context, + DiagnosticDescriptor descriptor, + ISymbol symbol, + params object[] args) + { + context.ReportDiagnostic(Diagnostic.Create(descriptor, symbol.Locations.FirstOrDefault(), args)); + } + + /// + /// Adds a new diagnostics to the current compilation. + /// + /// The instance currently in use. + /// The input for the diagnostics to create. + /// The source to attach the diagnostics to. + /// The optional arguments for the formatted message to include. + public static void ReportDiagnostic( + this GeneratorExecutionContext context, + DiagnosticDescriptor descriptor, + SyntaxNode node, + params object[] args) + { + context.ReportDiagnostic(Diagnostic.Create(descriptor, node.GetLocation(), args)); + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/Extensions/ISymbolExtensions.cs b/src/ComputeSharp.SourceGenerators/Extensions/ISymbolExtensions.cs new file mode 100644 index 00000000..f89b5aa1 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Extensions/ISymbolExtensions.cs @@ -0,0 +1,161 @@ +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Text; +using ComputeSharp.SourceGenerators.Mappings; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace ComputeSharp.SourceGenerators.Extensions +{ + /// + /// Extension methods for types. + /// + internal static class ISymbolExtensions + { + /// + /// A custom instance with fully qualified style, without global::. + /// + public static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalFormat = new( + globalNamespaceStyle: SymbolDisplayGlobalNamespaceStyle.Omitted, + typeQualificationStyle: SymbolDisplayTypeQualificationStyle.NameAndContainingTypesAndNamespaces, + genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters); + + /// + /// A custom instance with fully qualified style, without global:: and parameters. + /// + private static readonly SymbolDisplayFormat FullyQualifiedWithoutGlobalAndParametersFormat = + FullyQualifiedWithoutGlobalFormat + .WithMemberOptions(SymbolDisplayMemberOptions.IncludeContainingType) + .WithParameterOptions(SymbolDisplayParameterOptions.None); + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this ITypeSymbol symbol) + { + static StringBuilder BuildFrom(ISymbol? symbol, StringBuilder builder) + { + return symbol switch + { + INamespaceSymbol ns when ns.IsGlobalNamespace => builder, + INamespaceSymbol ns when ns.ContainingNamespace is { IsGlobalNamespace: false } + => BuildFrom(ns.ContainingNamespace, builder.Insert(0, $".{ns.MetadataName}")), + ITypeSymbol ts when ts.ContainingType is ISymbol pt => BuildFrom(pt, builder.Insert(0, $"+{ts.MetadataName}")), + ITypeSymbol ts when ts.ContainingNamespace is ISymbol pn => BuildFrom(pn, builder.Insert(0, $".{ts.MetadataName}")), + ISymbol => BuildFrom(symbol.ContainingSymbol, builder.Insert(0, symbol.MetadataName)), + _ => builder + }; + } + + return BuildFrom(symbol, new StringBuilder(256)).ToString(); + } + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// Whether or not to also include parameter types. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this IMethodSymbol symbol, bool includeParameters = false) + { + if (includeParameters) + { + var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); + + return $"{symbol.ToDisplayString(FullyQualifiedWithoutGlobalAndParametersFormat)}({parameters})"; + } + + return symbol.ToDisplayString(FullyQualifiedWithoutGlobalAndParametersFormat); + } + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this IPropertySymbol symbol) + { + string declaringTypeName = symbol.ContainingType.GetFullMetadataName(); + + if (symbol.IsIndexer) + { + var parameters = string.Join(", ", symbol.Parameters.Select(static p => ((INamedTypeSymbol)p.Type).GetFullMetadataName())); + + return $"{declaringTypeName}.this[{parameters}]"; + } + + return $"{declaringTypeName}.{symbol.Name}"; + } + + /// + /// Gets the full metadata name for a given instance. + /// + /// The input instance. + /// The full metadata name for . + [Pure] + public static string GetFullMetadataName(this IFieldSymbol symbol) + { + return $"{symbol.ContainingType.GetFullMetadataName()}.{symbol.Name}"; + } + + /// + /// Gets a valid filename for a target symbol and generator type. + /// + /// The generator type processing the input symbol. + /// The symbol being processed. + /// A filename in the form "[ComputeSharp]_[<TGENERATOR>]_[<SYMBOL_FULLNAME>]" + [Pure] + public static string GetGeneratedFileName(this INamedTypeSymbol symbol) + { + string + metadataName = symbol.GetFullMetadataName(), + fixedName = metadataName.Replace('`', '-').Replace('+', '.'); + + return $"[{nameof(ComputeSharp)}]_[{typeof(TGenerator).Name}]_[{fixedName}]"; + } + + /// + /// Gets a valid filename for a target symbol and generator type. + /// + /// The generator type processing the input symbol. + /// The symbol being processed. + /// A filename in the form "[ComputeSharp]_[<TGENERATOR>]_[<SYMBOL_FULLNAME>]" + [Pure] + public static string GetGeneratedFileName(this IMethodSymbol symbol) + { + string + metadataName = symbol.GetFullMetadataName(true), + fixedName = metadataName.Replace('`', '-').Replace('+', '.'); + + return $"[{nameof(ComputeSharp)}]_[{typeof(TGenerator).Name}]_[{fixedName}]"; + } + + /// + /// Tracks an instance and returns an HLSL compatible object. + /// + /// The input instance to process. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TypeSyntax TrackType(this ITypeSymbol typeSymbol, ICollection discoveredTypes) + { + string typeName = typeSymbol.ToDisplayString(FullyQualifiedWithoutGlobalFormat); + + discoveredTypes.Add((INamedTypeSymbol)typeSymbol); + + if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) + { + return ParseTypeName(mappedName!); + } + + return ParseTypeName(typeName.Replace(".", "__")); + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/Extensions/SyntaxNodeExtensions.cs b/src/ComputeSharp.SourceGenerators/Extensions/SyntaxNodeExtensions.cs new file mode 100644 index 00000000..3a29bc8d --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Extensions/SyntaxNodeExtensions.cs @@ -0,0 +1,176 @@ +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using ComputeSharp.SourceGenerators.Mappings; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace ComputeSharp.SourceGenerators.Extensions +{ + /// + /// A with some extension methods for C# syntax nodes. + /// + internal static class SyntaxNodeExtensions + { + /// + /// Checks a value and replaces the value type to be HLSL compatible, if needed. + /// + /// The type of the input instance. + /// The input to check and modify if needed. + /// The source to use to get type into from . + /// The instance with info on the input tree. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TRoot ReplaceAndTrackType(this TRoot node, SyntaxNode sourceType, SemanticModel semanticModel, ICollection discoveredTypes) + where TRoot : TypeSyntax + { + return node.ReplaceAndTrackType(node, sourceType, semanticModel, discoveredTypes); + } + + /// + /// Checks a value and replaces the value type to be HLSL compatible, if needed. + /// + /// The type of the input instance. + /// The input to check and modify if needed. + /// The target node to replace. + /// The source to use to get type into from . + /// The instance with info on the input tree. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TRoot ReplaceAndTrackType(this TRoot node, TypeSyntax targetType, SyntaxNode sourceType, SemanticModel semanticModel, ICollection discoveredTypes) + where TRoot : SyntaxNode + { + // Skip immediately for function pointers + if (sourceType is FunctionPointerTypeSyntax) + { + return node.ReplaceNode(targetType, ParseTypeName("void*")); + } + + // Handle the various possible type kinds + ITypeSymbol typeSymbol = sourceType switch + { + RefTypeSyntax refType => semanticModel.GetTypeInfo(refType.Type).Type!, + PointerTypeSyntax pointerType => semanticModel.GetTypeInfo(pointerType.ElementType).Type!, + _ => semanticModel.GetTypeInfo(sourceType).Type! + }; + + // Do nothing if the type is just void + if (typeSymbol.SpecialType == SpecialType.System_Void) + { + return node; + } + + string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat); + + discoveredTypes.Add((INamedTypeSymbol)typeSymbol); + + if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) + { + TypeSyntax newType = ParseTypeName(mappedName!); + + return node.ReplaceNode(targetType, newType); + } + + return node.ReplaceNode(targetType, ParseTypeName(typeName.Replace(".", "__"))); + } + + /// + /// Tracks the associated type for a value and returns the HLSL compatible . + /// + /// The input to check. + /// The instance with info on the input tree. + /// The collection of currently discovered types. + /// A instance that represents a type compatible with HLSL. + [Pure] + public static TypeSyntax TrackType(this SyntaxNode node, SemanticModel semanticModel, ICollection discoveredTypes) + { + ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(node).Type!; + string typeName = typeSymbol.ToDisplayString(ISymbolExtensions.FullyQualifiedWithoutGlobalFormat); + + discoveredTypes.Add((INamedTypeSymbol)typeSymbol); + + if (HlslKnownTypes.TryGetMappedName(typeName, out string? mappedName)) + { + return ParseTypeName(mappedName!); + } + + return ParseTypeName(typeName.Replace(".", "__")); + } + + /// + /// Returns a with a block body. + /// + /// The input node. + /// A node like the one in input, but always with a block body. + [Pure] + public static MethodDeclarationSyntax WithBlockBody(this MethodDeclarationSyntax node) + { + if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow) + { + StatementSyntax statement = node.ReturnType switch + { + PredefinedTypeSyntax pts when pts.Keyword.IsKind(SyntaxKind.VoidKeyword) => ExpressionStatement(arrow.Expression), + _ => ReturnStatement(arrow.Expression) + }; + + return node + .WithBody(Block(statement)) + .WithExpressionBody(null) + .WithSemicolonToken(MissingToken(SyntaxKind.SemicolonToken)); + } + + return node; + } + + /// + /// Returns a with a block body. + /// + /// The input node. + /// A node like the one in input, but always with a block body. + /// + /// This method is the same as , but it is necessary to + /// duplicate the code because the two types don't have a common base type or interface that can be leveraged. + /// + [Pure] + public static LocalFunctionStatementSyntax WithBlockBody(this LocalFunctionStatementSyntax node) + { + if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow) + { + StatementSyntax statement = node.ReturnType switch + { + PredefinedTypeSyntax pts when pts.Keyword.IsKind(SyntaxKind.VoidKeyword) => ExpressionStatement(arrow.Expression), + _ => ReturnStatement(arrow.Expression) + }; + + return node + .WithBody(Block(statement)) + .WithExpressionBody(null) + .WithSemicolonToken(MissingToken(SyntaxKind.SemicolonToken)); + } + + return node; + } + + /// + /// Returns a instance with no accessibility modifiers. + /// + /// The input node. + /// A node just like but with no accessibility modifiers. + [Pure] + public static MethodDeclarationSyntax WithoutAccessibilityModifiers(this MethodDeclarationSyntax node) + { + return node.WithModifiers(TokenList(node.Modifiers.Where(static modifier => modifier.Kind() switch + { + SyntaxKind.PublicKeyword => false, + SyntaxKind.PrivateKeyword => false, + SyntaxKind.ProtectedKeyword => false, + SyntaxKind.InternalKeyword => false, + _ => true + }).ToArray())); + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs new file mode 100644 index 00000000..894f6630 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs @@ -0,0 +1,93 @@ +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace ComputeSharp.SourceGenerators.Helpers +{ + /// + /// A class containing additional factory methods for constructing syntax nodes, tokens and trivia. + /// + internal static class SyntaxFactoryHelper + { + /// + /// Creates a [] array expression from the given sequence of instances. + /// + /// That it, it applies the following transformation: + /// + /// { "S1", "S2" } => new string[] { "S1", "S2" } + /// + /// + /// + /// The input sequence of instances. + /// An instance with the described contents. + [Pure] + public static ArrayCreationExpressionSyntax ArrayExpression(IEnumerable values) + { + return + ArrayCreationExpression( + ArrayType(PredefinedType(Token(SyntaxKind.StringKeyword))) + .AddRankSpecifiers(ArrayRankSpecifier(SingletonSeparatedList(OmittedArraySizeExpression())))) + .WithInitializer(InitializerExpression(SyntaxKind.ArrayInitializerExpression) + .AddExpressions(values.Select(static value => LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(value))).ToArray())); + } + + /// + /// Creates an [] array expression with the nested groups in the input sequence. + /// + /// That it, it applies the following transformation: + /// + /// { ("K1", "V1"), ("K2", "V2") } => new object[] { new[] { "K1", "V1" }, new[] { "K2", "V2" } } + /// + /// + /// + /// The input sequence of groups. + /// An instance with the described contents. + [Pure] + public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable> groups) + { + return + ArrayCreationExpression( + ArrayType(PredefinedType(Token(SyntaxKind.ObjectKeyword))) + .AddRankSpecifiers(ArrayRankSpecifier(SingletonSeparatedList(OmittedArraySizeExpression())))) + .WithInitializer(InitializerExpression(SyntaxKind.ArrayInitializerExpression) + .AddExpressions(groups.Select(static group => + ImplicitArrayCreationExpression(InitializerExpression(SyntaxKind.ArrayInitializerExpression).AddExpressions( + group.Select(static item => LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(item))).ToArray()))).ToArray())); + } + + /// + /// Creates an [] array expression with the nested groups in the input sequence. + /// + /// That it, it applies the following transformation: + /// + /// { ("K1", "V1", I1), ("K2", "V2", null) } => new object[] { new object[] { "K1", "V1", I1 }, new object[] { "K2", "V2", null } } + /// + /// + /// + /// The input sequence of groups. + /// An instance with the described contents. + [Pure] + public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<(string A, string B, int? C)> groups) + { + return + ArrayCreationExpression( + ArrayType(PredefinedType(Token(SyntaxKind.ObjectKeyword))) + .AddRankSpecifiers(ArrayRankSpecifier(SingletonSeparatedList(OmittedArraySizeExpression())))) + .WithInitializer(InitializerExpression(SyntaxKind.ArrayInitializerExpression) + .AddExpressions(groups.Select(static group => + ArrayCreationExpression( + ArrayType(PredefinedType(Token(SyntaxKind.ObjectKeyword))) + .AddRankSpecifiers(ArrayRankSpecifier(SingletonSeparatedList(OmittedArraySizeExpression())))) + .WithInitializer(InitializerExpression(SyntaxKind.ArrayInitializerExpression) + .AddExpressions( + LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(group.A)), + LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(group.B)), + group.C is int i + ? LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(i)) + : LiteralExpression(SyntaxKind.NullLiteralExpression)))).ToArray())); + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/IComputeShaderDataLoaderGenerator.cs b/src/ComputeSharp.SourceGenerators/IComputeShaderDataLoaderGenerator.cs new file mode 100644 index 00000000..beaff28e --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/IComputeShaderDataLoaderGenerator.cs @@ -0,0 +1,244 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Text; +using ComputeSharp.__Internals; +using ComputeSharp.Core.Helpers; +using ComputeSharp.SourceGenerators.Diagnostics; +using ComputeSharp.SourceGenerators.Extensions; +using ComputeSharp.SourceGenerators.Mappings; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +#pragma warning disable CS0618 + +namespace ComputeSharp.SourceGenerators +{ + [Generator] + public class IComputeShaderDataLoaderGenerator : ISourceGenerator + { + /// + public void Initialize(GeneratorInitializationContext context) + { + } + + /// + public void Execute(GeneratorExecutionContext context) + { + // Find all the struct declarations + ImmutableArray structDeclarations = ( + from tree in context.Compilation.SyntaxTrees + from structDeclaration in tree.GetRoot().DescendantNodes().OfType() + select structDeclaration).ToImmutableArray(); + + // Type attributes + AttributeListSyntax[] attributes = new[] + { + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("EditorBrowsable")).AddArgumentListArguments( + AttributeArgument(ParseExpression("EditorBrowsableState.Never"))))), + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("Obsolete")).AddArgumentListArguments( + AttributeArgument(LiteralExpression( + SyntaxKind.StringLiteralExpression, + Literal("This type is not intended to be used directly by user code")))))) + }; + + foreach (StructDeclarationSyntax structDeclaration in structDeclarations) + { + SemanticModel semanticModel = context.Compilation.GetSemanticModel(structDeclaration.SyntaxTree); + INamedTypeSymbol structDeclarationSymbol = semanticModel.GetDeclaredSymbol(structDeclaration)!; + + try + { + OnExecute(context, structDeclaration, structDeclarationSymbol, ref attributes); + } + catch + { + context.ReportDiagnostic(IComputeShaderDataLoaderGeneratorError, structDeclaration, structDeclarationSymbol); + } + } + } + + /// + /// Processes a given target type. + /// + /// The input instance to use. + /// The node to process. + /// The for . + /// The list of instances to append to the first copy of the partial class being generated. + private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol, ref AttributeListSyntax[] attributes) + { + // Only process compute shader types + if (!structDeclarationSymbol.Interfaces.Any(static interfaceSymbol => interfaceSymbol.Name == nameof(IComputeShader))) return; + + TypeSyntax shaderType = ParseTypeName(structDeclarationSymbol.ToDisplayString()); + BlockSyntax block = Block(GetDispatchDataLoadingStatements(structDeclarationSymbol, out int root32BitConstantsCount)); + + // Create a static method to create the combined hashcode for a given shader type. + // This code takes a block syntax and produces a compilation unit as follows: + // + // using System; + // using System.ComponentModel; + // + // namespace ComputeSharp.__Internals + // { + // internal static partial class DispatchDataLoader + // { + // [System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)] + // [System.Obsolete("This method is not intended to be called directly by user code")] + // [return: ComputeRoot32BitConstants(42)] + // public static int LoadDispatchData(GraphicsDevice device, in ShaderType shader, ref ulong r0, ref byte r1) + // { + // ... + // } + // } + // } + var source = + CompilationUnit().AddUsings( + UsingDirective(IdentifierName("System")), + UsingDirective(IdentifierName("System.ComponentModel")), + UsingDirective(IdentifierName("System.Runtime.CompilerServices"))).AddMembers( + NamespaceDeclaration(IdentifierName("ComputeSharp.__Internals")).AddMembers( + ClassDeclaration("DispatchDataLoader").AddModifiers( + Token(SyntaxKind.InternalKeyword), + Token(SyntaxKind.StaticKeyword), + Token(SyntaxKind.PartialKeyword)).AddAttributeLists(attributes).AddMembers( + MethodDeclaration( + PredefinedType(Token(SyntaxKind.IntKeyword)), + Identifier("LoadDispatchData")).AddAttributeLists( + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("EditorBrowsable")).AddArgumentListArguments( + AttributeArgument(ParseExpression("EditorBrowsableState.Never"))))), + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("Obsolete")).AddArgumentListArguments( + AttributeArgument(LiteralExpression( + SyntaxKind.StringLiteralExpression, + Literal("This method is not intended to be called directly by user code")))))), + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName(nameof(ComputeRoot32BitConstantsAttribute).Replace("Attribute", ""))) + .AddArgumentListArguments(AttributeArgument(LiteralExpression( + SyntaxKind.NumericLiteralExpression, + Literal(root32BitConstantsCount)))))) + .WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.ReturnKeyword)))).AddModifiers( + Token(SyntaxKind.PublicKeyword), + Token(SyntaxKind.StaticKeyword)).AddParameterListParameters( + Parameter(Identifier("device")).WithType(IdentifierName("ComputeSharp.GraphicsDevice")), + Parameter(Identifier("shader")).WithModifiers(TokenList(Token(SyntaxKind.InKeyword))).WithType(shaderType), + Parameter(Identifier("r0")).AddModifiers(Token(SyntaxKind.RefKeyword)).WithType(PredefinedType(Token(SyntaxKind.ULongKeyword))), + Parameter(Identifier("r1")).AddModifiers(Token(SyntaxKind.RefKeyword)).WithType(PredefinedType(Token(SyntaxKind.ByteKeyword)))) + .WithBody(block))) + .WithNamespaceKeyword(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.NamespaceKeyword, TriviaList()))) + .NormalizeWhitespace() + .ToFullString(); + + // Clear the attribute list to avoid duplicates + attributes = Array.Empty(); + + // Add the method source attribute + context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } + + /// + /// Gets a sequence of statements to load the dispatch data for a given shader + /// + /// The input instance to process. + /// The total number of 32 bit root constants to load. + /// The sequence of instances to load shader dispatch data. + [Pure] + private static IEnumerable GetDispatchDataLoadingStatements(INamedTypeSymbol structDeclarationSymbol, out int count) + { + List statements = new(); + + int + resourceOffset = 0, + rawDataOffset = sizeof(int) * 3; + + foreach ( + IFieldSymbol fieldSymbol in + from fieldSymbol in structDeclarationSymbol.GetMembers().OfType() + where fieldSymbol.Type is INamedTypeSymbol { IsStatic: false } && + !fieldSymbol.IsConst + select fieldSymbol) + { + string typeName = fieldSymbol.Type.GetFullMetadataName(); + + if (HlslKnownTypes.IsTypedResourceType(typeName)) + { + statements.Add(ExpressionStatement( + AssignmentExpression( + SyntaxKind.SimpleAssignmentExpression, + ParseExpression($"Unsafe.Add(ref r0, {resourceOffset++})"), + ParseExpression($"GraphicsResourceHelper.ValidateAndGetGpuDescriptorHandle(shader.{fieldSymbol.Name}, device)")))); + } + else if (HlslKnownTypes.IsKnownHlslType(typeName)) + { + // For scalar, vector and linear matrix types, serialize the value normally. + // Only the initial alignment needs to be considered, while data is packed. + var (fieldSize, fieldPack) = HlslKnownSizes.GetTypeInfo(typeName); + + // Check if the current type is a matrix type with more than one row. In this + // case, each row is aligned as if it was a separate array, so the start of + // each row needs to be at a multiple of 16 bytes (a float4 register). + if (HlslKnownTypes.IsNonLinearMatrixType(typeName, out string? elementName, out int rows, out int columns)) + { + string + rowTypeName = $"ComputeSharp.{elementName}{columns}", + rowLocalName = $"__{fieldSymbol.Name}__row0"; + + statements.Add(ParseStatement($"ref {rowTypeName} {rowLocalName} = ref Unsafe.As<{typeName}, {rowTypeName}>(ref Unsafe.AsRef(in shader.{fieldSymbol.Name}));")); + + // Generate the loading code for each individual row, with proper alignment. + // This will result in the following (assuming Float2x3 m): + // + // ref Float3 __m__row0 = ref Unsafe.As(ref Unsafe.AsRef(in shader.m)); + // Unsafe.WriteUnaligned(ref Unsafe.Add(ref r1, rawDataOffset), Unsafe.Add(ref __m__row0, 0)); + // Unsafe.WriteUnaligned(ref Unsafe.Add(ref r1, rawDataOffset + 16), Unsafe.Add(ref __m__row0, 1)); + for (int j = 0; j < rows; j++) + { + rawDataOffset = AlignmentHelper.Pad(rawDataOffset, 16); + + statements.Add(ParseStatement($"Unsafe.WriteUnaligned(ref Unsafe.Add(ref r1, {rawDataOffset}), Unsafe.Add(ref {rowLocalName}, {j}));")); + + rawDataOffset += fieldPack * columns; + } + } + else + { + // Calculate the right offset with 16-bytes padding (HLSL constant buffer). + // Since we're in a constant buffer, we need to both pad the starting offset + // to be aligned to the packing size of the type, and also to align the initial + // offset to ensure that values do not cross 16 bytes boundaries either. + rawDataOffset = AlignmentHelper.AlignToBoundary( + AlignmentHelper.Pad(rawDataOffset, fieldPack), + fieldSize, + 16); + + statements.Add(ParseStatement($"Unsafe.WriteUnaligned(ref Unsafe.Add(ref r1, {rawDataOffset}), shader.{fieldSymbol.Name});")); + + rawDataOffset += fieldSize; + } + } + } + + // After all the captured fields have been processed, ansure the reported byte size for + // the local variables is padded to a multiple of a 32 bit value. This is necessary to + // enable loading all the dispatch data after reinterpreting it to a sequence of values + // of size 32 bits (via SetComputeRoot32BitConstants), without reading out of bounds. + rawDataOffset = AlignmentHelper.Pad(rawDataOffset, sizeof(int)); + + statements.Add(ReturnStatement(LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(rawDataOffset)))); + + count = rawDataOffset / sizeof(int); + + return statements; + } + } +} + diff --git a/src/ComputeSharp.SourceGenerators/IComputeShaderHashCodeGenerator.cs b/src/ComputeSharp.SourceGenerators/IComputeShaderHashCodeGenerator.cs new file mode 100644 index 00000000..31ffe4a4 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/IComputeShaderHashCodeGenerator.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Text; +using ComputeSharp.SourceGenerators.Diagnostics; +using ComputeSharp.SourceGenerators.Extensions; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace ComputeSharp.SourceGenerators +{ + [Generator] + public class IComputeShaderHashCodeGenerator : ISourceGenerator + { + /// + public void Initialize(GeneratorInitializationContext context) + { + } + + /// + public void Execute(GeneratorExecutionContext context) + { + // Find all the struct declarations + ImmutableArray structDeclarations = ( + from tree in context.Compilation.SyntaxTrees + from structDeclaration in tree.GetRoot().DescendantNodes().OfType() + select structDeclaration).ToImmutableArray(); + + // Type attributes + AttributeListSyntax[] attributes = new[] + { + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("EditorBrowsable")).AddArgumentListArguments( + AttributeArgument(ParseExpression("EditorBrowsableState.Never"))))), + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("Obsolete")).AddArgumentListArguments( + AttributeArgument(LiteralExpression( + SyntaxKind.StringLiteralExpression, + Literal("This type is not intended to be used directly by user code")))))) + }; + + foreach (StructDeclarationSyntax structDeclaration in structDeclarations) + { + SemanticModel semanticModel = context.Compilation.GetSemanticModel(structDeclaration.SyntaxTree); + INamedTypeSymbol structDeclarationSymbol = semanticModel.GetDeclaredSymbol(structDeclaration)!; + + try + { + OnExecute(context, structDeclaration, structDeclarationSymbol, ref attributes); + } + catch + { + context.ReportDiagnostic(IComputeShaderHashCodeGeneratorError, structDeclaration, structDeclarationSymbol); + } + } + } + + /// + /// Processes a given target type. + /// + /// The input instance to use. + /// The node to process. + /// The for . + /// The list of instances to append to the first copy of the partial class being generated. + private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol, ref AttributeListSyntax[] attributes) + { + // Only process compute shader types + if (!structDeclarationSymbol.Interfaces.Any(static interfaceSymbol => interfaceSymbol.Name == nameof(IComputeShader))) return; + + TypeSyntax shaderType = ParseTypeName(structDeclarationSymbol.ToDisplayString()); + BlockSyntax block = Block(GetDelegateHashCodeStatements(structDeclarationSymbol)); + + if (block.Statements.Count == 1) return; + + // Create a static method to create the combined hashcode for a given shader type. + // This code takes a block syntax and produces a compilation unit as follows: + // + // using System; + // using System.ComponentModel; + // + // namespace ComputeSharp.__Internals + // { + // internal static partial class HashCodeProvider + // { + // [System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)] + // [System.Obsolete("This method is not intended to be called directly by user code")] + // public static int CombineHashCode(int hash, in ShaderType shader) + // { + // return ...; + // } + // } + // } + var source = + CompilationUnit().AddUsings( + UsingDirective(IdentifierName("System")), + UsingDirective(IdentifierName("System.ComponentModel"))).AddMembers( + NamespaceDeclaration(IdentifierName("ComputeSharp.__Internals")).AddMembers( + ClassDeclaration("HashCodeProvider").AddModifiers( + Token(SyntaxKind.InternalKeyword), + Token(SyntaxKind.StaticKeyword), + Token(SyntaxKind.PartialKeyword)).AddAttributeLists(attributes).AddMembers( + MethodDeclaration( + PredefinedType(Token(SyntaxKind.IntKeyword)), + Identifier("CombineHash")).AddAttributeLists( + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("EditorBrowsable")).AddArgumentListArguments( + AttributeArgument(ParseExpression("EditorBrowsableState.Never"))))), + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName("Obsolete")).AddArgumentListArguments( + AttributeArgument(LiteralExpression( + SyntaxKind.StringLiteralExpression, + Literal("This method is not intended to be called directly by user code"))))))).AddModifiers( + Token(SyntaxKind.PublicKeyword), + Token(SyntaxKind.StaticKeyword)).AddParameterListParameters( + Parameter(Identifier("hash")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), + Parameter(Identifier("shader")).WithModifiers(TokenList(Token(SyntaxKind.InKeyword))).WithType(shaderType)) + .WithBody(block)))) + .NormalizeWhitespace() + .ToFullString(); + + // Clear the attribute list to avoid duplicates + attributes = Array.Empty(); + + // Add the method source attribute + context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } + + /// + /// Gets a sequence of statements to process the hashcode of the captured delegates. + /// + /// The input instance to process. + /// The sequence of instances to hash the captured delegates. + [Pure] + private static IEnumerable GetDelegateHashCodeStatements(INamedTypeSymbol structDeclarationSymbol) + { + foreach (var fieldSymbol in structDeclarationSymbol.GetMembers().OfType()) + { + if (fieldSymbol.Type is not INamedTypeSymbol { TypeKind: TypeKind.Delegate, IsStatic: false } typeSymbol) + { + continue; + } + + // hash += hash << 5; + yield return ExpressionStatement(ParseExpression($"hash += hash << 5")); + + // hash += shader.Field[#i].Method.GetHashCode(); + yield return ExpressionStatement(ParseExpression($"hash += shader.{fieldSymbol.Name}.Method.GetHashCode()")); + } + + yield return ReturnStatement(IdentifierName("hash")); + } + } +} + diff --git a/src/ComputeSharp.SourceGenerators/IComputeShaderSourceGenerator.cs b/src/ComputeSharp.SourceGenerators/IComputeShaderSourceGenerator.cs new file mode 100644 index 00000000..1970146f --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/IComputeShaderSourceGenerator.cs @@ -0,0 +1,348 @@ +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Text; +using ComputeSharp.__Internals; +using ComputeSharp.SourceGenerators.Diagnostics; +using ComputeSharp.SourceGenerators.Extensions; +using ComputeSharp.SourceGenerators.Mappings; +using ComputeSharp.SourceGenerators.SyntaxRewriters; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using static ComputeSharp.SourceGenerators.Helpers.SyntaxFactoryHelper; +using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +#pragma warning disable CS0618 + +namespace ComputeSharp.SourceGenerators +{ + [Generator] + public class IComputeShaderSourceGenerator : ISourceGenerator + { + /// + public void Initialize(GeneratorInitializationContext context) + { + } + + /// + public void Execute(GeneratorExecutionContext context) + { + // Find all the struct declarations + ImmutableArray structDeclarations = ( + from tree in context.Compilation.SyntaxTrees + from structDeclaration in tree.GetRoot().DescendantNodes().OfType() + select structDeclaration).ToImmutableArray(); + + foreach (StructDeclarationSyntax structDeclaration in structDeclarations) + { + SemanticModel semanticModel = context.Compilation.GetSemanticModel(structDeclaration.SyntaxTree); + INamedTypeSymbol structDeclarationSymbol = semanticModel.GetDeclaredSymbol(structDeclaration)!; + + try + { + OnExecute(context, structDeclaration, semanticModel, structDeclarationSymbol); + } + catch + { + context.ReportDiagnostic(IComputeShaderSourceGeneratorError, structDeclaration, structDeclarationSymbol); + } + } + } + + /// + /// Processes a given target type. + /// + /// The input instance to use. + /// The node to process. + /// The with metadata on the types being processed. + /// The for . + private static void OnExecute(GeneratorExecutionContext context, StructDeclarationSyntax structDeclaration, SemanticModel semanticModel, INamedTypeSymbol structDeclarationSymbol) + { + // Only process compute shader types + if (!structDeclarationSymbol.Interfaces.Any(static interfaceSymbol => interfaceSymbol.Name == nameof(IComputeShader))) return; + + // We need to sets to track all discovered custom types and static methods + HashSet discoveredTypes = new(SymbolEqualityComparer.Default); + Dictionary staticMethods = new(SymbolEqualityComparer.Default); + Dictionary constantDefinitions = new(SymbolEqualityComparer.Default); + + // Explore the syntax tree and extract the processed info + var processedMembers = GetProcessedMembers(context, structDeclarationSymbol, discoveredTypes).ToArray(); + var sharedBuffers = GetGroupSharedMembers(context, structDeclarationSymbol, discoveredTypes).ToArray(); + var (entryPoint, localFunctions) = GetProcessedMethods(context, structDeclaration, structDeclarationSymbol, semanticModel, discoveredTypes, staticMethods, constantDefinitions); + var processedTypes = GetProcessedTypes(discoveredTypes).ToArray(); + var processedMethods = localFunctions.Concat(staticMethods.Values).Select(static method => method.NormalizeWhitespace().ToFullString()).ToArray(); + var processedConstants = GetProcessedConstants(constantDefinitions); + + // Create the compilation unit with the source attribute + var source = + CompilationUnit().AddUsings( + UsingDirective(IdentifierName("ComputeSharp.__Internals"))).AddAttributeLists( + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName(typeof(IComputeShaderSourceAttribute).FullName)).AddArgumentListArguments( + AttributeArgument(TypeOfExpression(IdentifierName(structDeclarationSymbol.ToDisplayString()))), + AttributeArgument(ArrayExpression(processedTypes)), + AttributeArgument(NestedArrayExpression(processedMembers)), + AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(entryPoint))), + AttributeArgument(ArrayExpression(processedMethods)), + AttributeArgument(NestedArrayExpression(processedConstants)), + AttributeArgument(NestedArrayExpression(sharedBuffers))))) + .WithOpenBracketToken(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.OpenBracketToken, TriviaList())) + .WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)))) + .NormalizeWhitespace() + .ToFullString(); + + // Add the method source attribute + context.AddSource(structDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } + + /// + /// Gets a sequence of captured members and their mapped names. + /// + /// The current generator context in use. + /// The input instance to process. + /// The collection of currently discovered types. + /// A sequence of captured members in . + [Pure] + private static IEnumerable> GetProcessedMembers( + GeneratorExecutionContext context, + INamedTypeSymbol structDeclarationSymbol, + ICollection types) + { + bool hlslResourceFound = false; + + foreach (var fieldSymbol in structDeclarationSymbol.GetMembers().OfType()) + { + if (fieldSymbol.IsStatic) continue; + + AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) }); + + // Group shared fields must be static + if (attribute is not null) + { + context.ReportDiagnostic(InvalidGroupSharedFieldDeclaration, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name); + } + + // Captured fields must be named type symbols + if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol) + { + context.ReportDiagnostic(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); + + continue; + } + + string metadataName = typeSymbol.GetFullMetadataName(); + + // Allowed fields must be either resources, unmanaged values or delegates + if (HlslKnownTypes.IsTypedResourceType(metadataName)) + { + hlslResourceFound = true; + + // Track the type of items in the current buffer + if (HlslKnownTypes.IsStructuredBufferType(metadataName)) + { + types.Add((INamedTypeSymbol)typeSymbol.TypeArguments[0]); + } + } + else if (!typeSymbol.IsUnmanagedType && + typeSymbol.TypeKind != TypeKind.Delegate) + { + // Shaders can only capture valid HLSL resource types or unmanaged types + context.ReportDiagnostic(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, typeSymbol); + + continue; + } + + string typeName = HlslKnownTypes.GetMappedName(typeSymbol); + + _ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping); + + // Yield back the current mapping for the name (if the name used a reserved keyword) + yield return new[] { fieldSymbol.Name, mapping ?? fieldSymbol.Name, typeName }; + } + + if (!hlslResourceFound) + { + context.ReportDiagnostic(MissingShaderResources, structDeclarationSymbol, structDeclarationSymbol); + } + } + + /// + /// Gets a sequence of captured members and their mapped names. + /// + /// The current generator context in use. + /// The input instance to process. + /// The collection of currently discovered types. + /// A sequence of captured members in . + [Pure] + private static IEnumerable<(string Name, string Type, int? Count)> GetGroupSharedMembers( + GeneratorExecutionContext context, + INamedTypeSymbol structDeclarationSymbol, + ICollection types) + { + foreach (var fieldSymbol in structDeclarationSymbol.GetMembers().OfType()) + { + if (!fieldSymbol.IsStatic) continue; + + AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) }); + + if (attribute is null) continue; + + if (fieldSymbol.Type is not IArrayTypeSymbol typeSymbol) + { + context.ReportDiagnostic(InvalidGroupSharedFieldType, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); + + continue; + } + + if (!typeSymbol.ElementType.IsUnmanagedType) + { + context.ReportDiagnostic(InvalidGroupSharedFieldElementType, fieldSymbol, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type); + + continue; + } + + int? bufferSize = (int?)attribute.ConstructorArguments.FirstOrDefault().Value; + + string typeName = HlslKnownTypes.GetMappedElementName(typeSymbol); + + _ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping); + + yield return (mapping ?? fieldSymbol.Name, typeName, bufferSize); + + types.Add((INamedTypeSymbol)typeSymbol.ElementType); + } + } + + /// + /// Gets a sequence of processed methods declared within a given type. + /// + /// The current generator context in use. + /// The type symbol for the shader type. + /// The instance for the current type. + /// The instance for the type to process. + /// The collection of currently discovered types. + /// The set of discovered and processed static methods. + /// The collection of discovered constant definitions. + /// A sequence of processed methods in , and the entry point. + [Pure] + private static (string EntryPoint, IEnumerable Methods) GetProcessedMethods( + GeneratorExecutionContext context, + StructDeclarationSyntax structDeclaration, + INamedTypeSymbol structDeclarationSymbol, + SemanticModel semanticModel, + ICollection discoveredTypes, + IDictionary staticMethods, + IDictionary constantDefinitions) + { + // Find all declared methods in the type + ImmutableArray methodDeclarations = ( + from syntaxNode in structDeclaration.DescendantNodes() + where syntaxNode.IsKind(SyntaxKind.MethodDeclaration) + select (MethodDeclarationSyntax)syntaxNode).ToImmutableArray(); + + string? entryPoint = null; + List methods = new(); + + foreach (MethodDeclarationSyntax methodDeclaration in methodDeclarations) + { + IMethodSymbol methodDeclarationSymbol = semanticModel.GetDeclaredSymbol(methodDeclaration)!; + bool isShaderEntryPoint = + methodDeclarationSymbol.Name == nameof(IComputeShader.Execute) && + methodDeclarationSymbol.ReturnsVoid && + methodDeclarationSymbol.TypeParameters.Length == 0 && + methodDeclarationSymbol.Parameters.Length == 0; + + // Create the source rewriter for the current method + ShaderSourceRewriter shaderSourceRewriter = new( + structDeclarationSymbol, + semanticModel, + discoveredTypes, + staticMethods, + constantDefinitions, + context, + isShaderEntryPoint); + + // Rewrite the method syntax tree + MethodDeclarationSyntax? processedMethod = shaderSourceRewriter.Visit(methodDeclaration)!.WithoutTrivia(); + + // Emit the extracted local functions first + foreach (var localFunction in shaderSourceRewriter.LocalFunctions) + { + methods.Add(localFunction.Value); + } + + // If the method is the shader entry point, do additional processing + if (isShaderEntryPoint) + { + processedMethod = new ExecuteMethodRewriter(shaderSourceRewriter).Visit(processedMethod)!; + + entryPoint = processedMethod.NormalizeWhitespace().ToFullString(); + } + else methods.Add(processedMethod); + } + + return (entryPoint!, methods); + } + + /// + /// Gets a sequence of discovered constants. + /// + /// The collection of discovered constant definitions. + /// A sequence of discovered constants to declare in the shader. + [Pure] + internal static IEnumerable> GetProcessedConstants(IReadOnlyDictionary constantDefinitions) + { + foreach (var constant in constantDefinitions) + { + var ownerTypeName = ((INamedTypeSymbol)constant.Key.ContainingSymbol).ToDisplayString().Replace(".", "__"); + var constantName = $"__{ownerTypeName}__{constant.Key.Name}"; + + yield return new string[] { constantName, constant.Value }; + } + } + + /// + /// Gets the sequence of processed discovered custom types. + /// + /// The sequence of discovered custom types. + /// A sequence of custom type definitions to add to the shader source. + internal static IEnumerable GetProcessedTypes(IEnumerable types) + { + foreach (var type in HlslKnownTypes.GetCustomTypes(types)) + { + var structType = type.GetFullMetadataName().Replace(".", "__"); + var structDeclaration = StructDeclaration(structType); + + // Declare the fields of the current type + foreach (var field in type.GetMembers().OfType()) + { + INamedTypeSymbol fieldType = (INamedTypeSymbol)field.Type; + + // Convert the name to the fully qualified HLSL version + if (!HlslKnownTypes.TryGetMappedName(fieldType.GetFullMetadataName(), out string? mapped)) + { + mapped = fieldType.GetFullMetadataName().Replace(".", "__"); + } + + structDeclaration = structDeclaration.AddMembers( + FieldDeclaration(VariableDeclaration( + IdentifierName(mapped!)).AddVariables( + VariableDeclarator(Identifier(field.Name))))); + } + + // Insert the trailing ; right after the closing bracket (after normalization) + yield return + structDeclaration + .NormalizeWhitespace() + .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) + .ToFullString(); + } + } + } +} + diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownKeywords.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownKeywords.cs new file mode 100644 index 00000000..5aec5569 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownKeywords.cs @@ -0,0 +1,73 @@ +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; +using ComputeSharp.Core.Intrinsics.Attributes; + +namespace ComputeSharp.SourceGenerators.Mappings +{ + /// + /// A that contains and maps known HLSL identifier names valid HLSL names. + /// + internal static class HlslKnownKeywords + { + /// + /// The mapping of known HLSL keywords. + /// + private static readonly IReadOnlyCollection KnownKeywords = BuildKnownKeywordsMap(); + + /// + /// Builds the mapping of all known HLSL keywords. + /// + [Pure] + private static IReadOnlyCollection BuildKnownKeywordsMap() + { + // HLSL keywords + HashSet knownKeywords = new(new[] + { + "asm", "asm_fragment", "cbuffer", "centroid", "column_major", + "compile", "discard", "dword", "export", "fxgroup", "groupshared", + "half", "inline", "inout", "line", "lineadj", "linear", "matrix", + "nointerpolation", "noperspective", "NULL", "packoffset", "pass", + "pixelfragment", "point", "precise", "register", "row_major", "sample", + "sampler", "shared", "snorm", "stateblock", "stateblock_state", "tbuffer", + "technique", "typedef", "triangle", "triangleadj", "uniform", "unorm", + "unsigned", "vector", "vertexfragment", "zero" + }); + + // Dispatch type names + knownKeywords.Add(nameof(ThreadIds)); + knownKeywords.Add(nameof(GroupIds)); + knownKeywords.Add(nameof(GroupSize)); + knownKeywords.Add(nameof(WarpIds)); + + // HLSL intrinsics method names + foreach (var method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static)) + { + string name = method.GetCustomAttribute()?.Name ?? method.Name; + + knownKeywords.Add(name); + } + + return knownKeywords; + } + + /// + /// Tries to get the mapped HLSL-compatible identifier name for the input identifier name. + /// + /// The input identifier name. + /// The mapped identifier name, if a replacement is needed. + /// The HLSL-compatible identifier name that can be used in an HLSL shader. + [Pure] + public static bool TryGetMappedName(string name, out string? mapped) + { + mapped = KnownKeywords.Contains(name) switch + { + true => $"__reserved__{name}", + false => null + }; + + return mapped is not null; + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs new file mode 100644 index 00000000..24da01ea --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs @@ -0,0 +1,360 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Numerics; +using System.Reflection; +using System.Text.RegularExpressions; + +namespace ComputeSharp.SourceGenerators.Mappings +{ + /// + /// A that contains and maps known HLSL member names to common .NET members. + /// + internal static class HlslKnownMembers + { + /// + /// The mapping of supported known indexers to HLSL resource type names. + /// + private static readonly IReadOnlyDictionary KnownResourceIndexers = new Dictionary + { + [$"ComputeSharp.ReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadWriteTexture2D`2.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.IReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", + [$"ComputeSharp.ReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.ReadOnlyTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.ReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.ReadWriteTexture3D`2.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.IReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3", + [$"ComputeSharp.IReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3" + }; + + /// + /// The mapping of supported known size accessors for HLSL resource types. + /// + private static readonly IReadOnlyDictionary KnownSizeAccessors = new Dictionary + { + ["ComputeSharp.Resources.Buffer`1.Length"] = (2, 0), + ["ComputeSharp.Resources.Texture2D`1.Width"] = (2, 0), + ["ComputeSharp.Resources.Texture2D`1.Height"] = (2, 1), + ["ComputeSharp.Resources.Texture3D`1.Width"] = (3, 0), + ["ComputeSharp.Resources.Texture3D`1.Height"] = (3, 1), + ["ComputeSharp.Resources.Texture3D`1.Depth"] = (3, 2), + ["ComputeSharp.IReadOnlyTexture2D`1.Width"] = (2, 0), + ["ComputeSharp.IReadOnlyTexture2D`1.Height"] = (2, 1), + ["ComputeSharp.IReadOnlyTexture3D`1.Width"] = (3, 0), + ["ComputeSharp.IReadOnlyTexture3D`1.Height"] = (3, 1), + ["ComputeSharp.IReadOnlyTexture3D`1.Depth"] = (3, 2), + ["ComputeSharp.IReadWriteTexture2D`1.Width"] = (2, 0), + ["ComputeSharp.IReadWriteTexture2D`1.Height"] = (2, 1), + ["ComputeSharp.IReadWriteTexture3D`1.Width"] = (3, 0), + ["ComputeSharp.IReadWriteTexture3D`1.Height"] = (3, 1), + ["ComputeSharp.IReadWriteTexture3D`1.Depth"] = (3, 2) + }; + + /// + /// The mapping of supported known members to HLSL names. + /// + private static readonly IReadOnlyDictionary KnownMembers = BuildKnownMembersMap(); + + /// + /// Builds the mapping of supported known members to HLSL names. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownMembersMap() + { + Dictionary knownMembers = new() + { + [$"{typeof(Vector2).FullName}.{nameof(Vector2.X)}"] = "x", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Y)}"] = "y", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Zero)}"] = "(float2)0", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.One)}"] = "float2(1.0f, 1.0f)", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.UnitX)}"] = "float2(1.0f, 0.0f)", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.UnitY)}"] = "float2(0.0f, 1.0f)", + + [$"{typeof(Vector3).FullName}.{nameof(Vector3.X)}"] = "x", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Y)}"] = "y", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Z)}"] = "z", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Zero)}"] = "(float3)0", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.One)}"] = "float3(1.0f, 1.0f, 1.0f)", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitX)}"] = "float3(1.0f, 0.0f, 0.0f)", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitY)}"] = "float3(0.0f, 1.0f, 0.0f)", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.UnitZ)}"] = "float3(0.0f, 0.0f, 1.0f)", + + [$"{typeof(Vector4).FullName}.{nameof(Vector4.X)}"] = "x", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Y)}"] = "y", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Z)}"] = "z", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.W)}"] = "w", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Zero)}"] = "(float4)0", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.One)}"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", + + [$"{typeof(Bool2).FullName}.{nameof(Bool2.False)}"] = "(bool2)0", + [$"{typeof(Bool2).FullName}.{nameof(Bool2.True)}"] = "bool2(true, true)", + [$"{typeof(Bool2).FullName}.{nameof(Bool2.TrueX)}"] = "bool2(true, false)", + [$"{typeof(Bool2).FullName}.{nameof(Bool2.TrueY)}"] = "bool2(false, true)", + + [$"{typeof(Bool3).FullName}.{nameof(Bool3.False)}"] = "(bool3)0", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.True)}"] = "bool3(true, true, true)", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueX)}"] = "bool3(true, false, false)", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueY)}"] = "bool3(false, true, false)", + [$"{typeof(Bool3).FullName}.{nameof(Bool3.TrueZ)}"] = "bool3(false, false, true)", + + [$"{typeof(Bool4).FullName}.{nameof(Bool4.False)}"] = "(bool4)0", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.True)}"] = "bool4(true, true, true, true)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueX)}"] = "bool4(true, false, false, false)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueY)}"] = "bool4(false, true, false, false)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueZ)}"] = "bool4(false, false, true, false)", + [$"{typeof(Bool4).FullName}.{nameof(Bool4.TrueW)}"] = "bool4(false, false, false, true)", + + [$"{typeof(Int2).FullName}.{nameof(Int2.Zero)}"] = "(int2)0", + [$"{typeof(Int2).FullName}.{nameof(Int2.One)}"] = "int2(1, 1)", + [$"{typeof(Int2).FullName}.{nameof(Int2.UnitX)}"] = "int2(1, 0)", + [$"{typeof(Int2).FullName}.{nameof(Int2.UnitY)}"] = "int2(0, 1)", + + [$"{typeof(Int3).FullName}.{nameof(Int3.Zero)}"] = "(int3)0", + [$"{typeof(Int3).FullName}.{nameof(Int3.One)}"] = "int3(1, 1, 1)", + [$"{typeof(Int3).FullName}.{nameof(Int3.UnitX)}"] = "int3(1, 0, 0)", + [$"{typeof(Int3).FullName}.{nameof(Int3.UnitY)}"] = "int3(0, 1, 0)", + [$"{typeof(Int3).FullName}.{nameof(Int3.UnitZ)}"] = "int3(0, 0, 1)", + + [$"{typeof(Int4).FullName}.{nameof(Int4.Zero)}"] = "(int4)0", + [$"{typeof(Int4).FullName}.{nameof(Int4.One)}"] = "int4(1, 1, 1, 1)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitX)}"] = "int4(1, 0, 0, 0)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitY)}"] = "int4(0, 1, 0, 0)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitZ)}"] = "int4(0, 0, 1, 0)", + [$"{typeof(Int4).FullName}.{nameof(Int4.UnitW)}"] = "int4(0, 0, 0, 1)", + + [$"{typeof(UInt2).FullName}.{nameof(UInt2.Zero)}"] = "(uint2)0", + [$"{typeof(UInt2).FullName}.{nameof(UInt2.One)}"] = "uint2(1u, 1u)", + [$"{typeof(UInt2).FullName}.{nameof(UInt2.UnitX)}"] = "uint2(1u, 0u)", + [$"{typeof(UInt2).FullName}.{nameof(UInt2.UnitY)}"] = "uint2(0u, 1u)", + + [$"{typeof(UInt3).FullName}.{nameof(UInt3.Zero)}"] = "(uint3)0", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.One)}"] = "uint3(1u, 1u, 1u)", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitX)}"] = "uint3(1u, 0u, 0u)", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitY)}"] = "uint3(0u, 1u, 0u)", + [$"{typeof(UInt3).FullName}.{nameof(UInt3.UnitZ)}"] = "uint3(0u, 0u, 1u)", + + [$"{typeof(UInt4).FullName}.{nameof(UInt4.Zero)}"] = "(uint4)0", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.One)}"] = "uint4(1u, 1u, 1u, 1u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitX)}"] = "uint4(1u, 0u, 0u, 0u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitY)}"] = "uint4(0u, 1u, 0u, 0u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitZ)}"] = "uint4(0u, 0u, 1u, 0u)", + [$"{typeof(UInt4).FullName}.{nameof(UInt4.UnitW)}"] = "uint4(0u, 0u, 0u, 1u)", + + [$"{typeof(Float2).FullName}.{nameof(Float2.Zero)}"] = "(float2)0", + [$"{typeof(Float2).FullName}.{nameof(Float2.One)}"] = "float2(1.0f, 1.0f)", + [$"{typeof(Float2).FullName}.{nameof(Float2.UnitX)}"] = "float2(1.0f, 0.0f)", + [$"{typeof(Float2).FullName}.{nameof(Float2.UnitY)}"] = "float2(0.0f, 1.0f)", + + [$"{typeof(Float3).FullName}.{nameof(Float3.Zero)}"] = "(float3)0", + [$"{typeof(Float3).FullName}.{nameof(Float3.One)}"] = "float3(1.0f, 1.0f, 1.0f)", + [$"{typeof(Float3).FullName}.{nameof(Float3.UnitX)}"] = "float3(1.0f, 0.0f, 0.0f)", + [$"{typeof(Float3).FullName}.{nameof(Float3.UnitY)}"] = "float3(0.0f, 1.0f, 0.0f)", + [$"{typeof(Float3).FullName}.{nameof(Float3.UnitZ)}"] = "float3(0.0f, 0.0f, 1.0f)", + + [$"{typeof(Float4).FullName}.{nameof(Float4.Zero)}"] = "(float4)0", + [$"{typeof(Float4).FullName}.{nameof(Float4.One)}"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitX)}"] = "float4(1.0f, 0.0f, 0.0f, 0.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitY)}"] = "float4(0.0f, 1.0f, 0.0f, 0.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitZ)}"] = "float4(0.0f, 0.0f, 1.0f, 0.0f)", + [$"{typeof(Float4).FullName}.{nameof(Float4.UnitW)}"] = "float4(0.0f, 0.0f, 0.0f, 1.0f)", + + [$"{typeof(Double2).FullName}.{nameof(Double2.Zero)}"] = "(double2)0", + [$"{typeof(Double2).FullName}.{nameof(Double2.One)}"] = "double2(1.0, 1.0)", + [$"{typeof(Double2).FullName}.{nameof(Double2.UnitX)}"] = "double2(1.0, 0.0)", + [$"{typeof(Double2).FullName}.{nameof(Double2.UnitY)}"] = "double2(0.0, 1.0)", + + [$"{typeof(Double3).FullName}.{nameof(Double3.Zero)}"] = "(double3)0", + [$"{typeof(Double3).FullName}.{nameof(Double3.One)}"] = "double3(1.0, 1.0, 1.0)", + [$"{typeof(Double3).FullName}.{nameof(Double3.UnitX)}"] = "double3(1.0, 0.0, 0.0)", + [$"{typeof(Double3).FullName}.{nameof(Double3.UnitY)}"] = "double3(0.0, 1.0, 0.0)", + [$"{typeof(Double3).FullName}.{nameof(Double3.UnitZ)}"] = "double3(0.0, 0.0, 1.0)", + + [$"{typeof(Double4).FullName}.{nameof(Double4.Zero)}"] = "(double4)0", + [$"{typeof(Double4).FullName}.{nameof(Double4.One)}"] = "double4(1.0, 1.0, 1.0, 1.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitX)}"] = "double4(1.0, 0.0, 0.0, 0.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitY)}"] = "double4(0.0, 1.0, 0.0, 0.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitZ)}"] = "double4(0.0, 0.0, 1.0, 0.0)", + [$"{typeof(Double4).FullName}.{nameof(Double4.UnitW)}"] = "double4(0.0, 0.0, 0.0, 1.0)" + }; + + // Programmatically load mappings for the instance members of the HLSL vector types + foreach (var item in + from type in HlslKnownTypes.KnownVectorTypes + from property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + select (Type: type, Property: property)) + { + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"{item.Property.Name.ToLower()}"); + } + + // Load mappings for the matrix properties as well + foreach (var item in + from type in HlslKnownTypes.KnownMatrixTypes + from property in type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + where Regex.IsMatch(property.Name, "^M[1-4]{2}$") + select (Type: type, Property: property)) + { + char + row = (char)(item.Property.Name[1] - 1), + column = (char)(item.Property.Name[2] - 1); + + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"_m{row}{column}"); + } + + // Store GroupIds.Index for a quicker comparison afterwards + PropertyInfo groupindexProperty = typeof(GroupIds).GetProperty(nameof(GroupIds.Index), BindingFlags.Static | BindingFlags.Public); + + // Programmatically load mappings for the dispatch types + foreach (var item in + from type in HlslKnownTypes.HlslDispatchTypes + from property in type.GetProperties(BindingFlags.Static | BindingFlags.Public) + select (Type: type, Property: property)) + { + if (item.Property == groupindexProperty) + { + // The thread group index is a standalone parameter, so if this property is used, we + // just map the access directly to that implicit and hidden parameter name instead. + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"__{nameof(GroupIds)}__get_Index"); + } + else + { + knownMembers.Add($"{item.Type.FullName}{Type.Delimiter}{item.Property.Name}", $"{item.Type.Name}.{item.Property.Name.ToLower()}"); + } + } + + // Programmatically load mappings for the group size + foreach (var property in typeof(GroupSize).GetProperties(BindingFlags.Static | BindingFlags.Public)) + { + string key = $"{typeof(GroupSize).FullName}{Type.Delimiter}{property.Name}"; + + switch (property.Name) + { + case nameof(GroupSize.Count): + knownMembers.Add(key, "__GroupSize__get_X * __GroupSize__get_Y * __GroupSize__get_Z"); + break; + case string name when name.Length == 1: + knownMembers.Add(key, $"__GroupSize__get_{name}"); + break; + case string name when name.Length == 1: + knownMembers.Add(key, $"__GroupSize__get_{name[0]} * __GroupSize__get_{name[1]}"); + break; + case string name when name.Length == 1: + knownMembers.Add(key, $"__GroupSize__get_{name[0]} * __GroupSize__get_{name[1]} * __GroupSize__get_{name[2]}"); + break; + } + } + + return knownMembers; + } + + /// + /// The mapping of supported known members to HLSL names. + /// + private static readonly IReadOnlyCollection KnownMatrixIndexers = BuildKnownMatrixIndexers(); + + /// + /// Builds the mapping of swizzled matrix indexer properties. + /// + [Pure] + private static IReadOnlyCollection BuildKnownMatrixIndexers() + { + return ( + from type in Assembly.GetExecutingAssembly().ExportedTypes + where Regex.IsMatch(type.FullName, @"ComputeSharp\.(Bool|Double|Float|Int|UInt)[1-4]x[1-4]") + from property in type.GetProperties() + let indices = property.GetIndexParameters() + where indices.Length > 0 && + indices.All(static index => index.ParameterType == typeof(MatrixIndex)) + let metadataName = $"{type.FullName}.this[{string.Join(", ", indices.Select(index => index.ParameterType))}]" + select metadataName).ToImmutableHashSet(); + } + + /// + /// The mapping of supported known members to HLSL names. + /// + private static readonly IReadOnlyCollection KnownMatrixIndices = BuildKnownMatrixIndices(); + + /// + /// Builds the mapping of swizzled matrix indices. + /// + [Pure] + private static IReadOnlyCollection BuildKnownMatrixIndices() + { + return ( + from name in Enum.GetNames(typeof(MatrixIndex)) + select $"{typeof(MatrixIndex).FullName}.{name}").ToImmutableHashSet(); + } + + /// + /// Checks whether or not a given property fullname matches a matrix swizzled indexer. + /// + /// The input fully qualified member name. + /// Whether or not is a matrix swizzled indexer. + [Pure] + public static bool IsKnownMatrixIndexer(string name) + { + return KnownMatrixIndexers.Contains(name); + } + + /// + /// Checks whether or not a given property fullname matches a matrix swizzled index. + /// + /// The input fully qualified member name. + /// Whether or not is a matrix swizzled index. + [Pure] + public static bool IsKnownMatrixIndex(string name) + { + return KnownMatrixIndices.Contains(name); + } + + /// + /// Tries to get the mapped HLSL-compatible member name for the input member name. + /// + /// The input fully qualified member name. + /// The mapped name, if one is found. + /// The HLSL-compatible member name that can be used in an HLSL shader. + [Pure] + public static bool TryGetMappedName(string name, out string? mapped) + { + return KnownMembers.TryGetValue(name, out mapped); + } + + /// + /// Tries to get the mapped HLSL-compatible indexer resource type name for the input indexer name. + /// + /// The input fully qualified indexer name. + /// The mapped type name, if one is found. + /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer. + [Pure] + public static bool TryGetMappedResourceIndexerTypeName(string name, out string? mapped) + { + return KnownResourceIndexers.TryGetValue(name, out mapped); + } + + /// + /// Tries to get the mapped HLSL-compatible indexer vector type name for the input indexer name. + /// + /// The input fully qualified indexer name. + /// The mapped type name, if one is found. + /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer. + [Pure] + public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis) + { + if (KnownSizeAccessors.TryGetValue(name, out var info)) + { + (rank, axis) = info; + + return true; + } + + (rank, axis) = default((int, int)); + + return false; + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMethods.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMethods.cs new file mode 100644 index 00000000..b33dd8b0 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMethods.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Numerics; +using System.Reflection; +using ComputeSharp.Core.Intrinsics.Attributes; + +namespace ComputeSharp.SourceGenerators.Mappings +{ + /// + /// A that contains and maps known HLSL method names to common .NET methods. + /// + internal static class HlslKnownMethods + { + /// + /// The mapping of supported known methods to HLSL names. + /// + private static readonly IReadOnlyDictionary KnownMethods = BuildKnownMethodsMap(); + + /// + /// Builds the mapping of supported known methods to HLSL names. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownMethodsMap() + { + Dictionary knownMethods = new() + { + [$"{typeof(Math).FullName}.{nameof(Math.Abs)}"] = "abs", + [$"{typeof(Math).FullName}.{nameof(Math.Max)}"] = "max", + [$"{typeof(Math).FullName}.{nameof(Math.Min)}"] = "min", + [$"{typeof(Math).FullName}.{nameof(Math.Pow)}"] = "pow", + [$"{typeof(Math).FullName}.{nameof(Math.Sin)}"] = "sin", + [$"{typeof(Math).FullName}.{nameof(Math.Sinh)}"] = "sinh", + [$"{typeof(Math).FullName}.{nameof(Math.Asin)}"] = "asin", + [$"{typeof(Math).FullName}.{nameof(Math.Cos)}"] = "cos", + [$"{typeof(Math).FullName}.{nameof(Math.Cosh)}"] = "cosh", + [$"{typeof(Math).FullName}.{nameof(Math.Acos)}"] = "acos", + [$"{typeof(Math).FullName}.{nameof(Math.Tan)}"] = "tan", + [$"{typeof(Math).FullName}.{nameof(Math.Tanh)}"] = "tanh", + [$"{typeof(Math).FullName}.{nameof(Math.Atan)}"] = "atan", + [$"{typeof(Math).FullName}.{nameof(Math.Atan2)}"] = "atan2", + [$"{typeof(Math).FullName}.{nameof(Math.Ceiling)}"] = "ceil", + [$"{typeof(Math).FullName}.{nameof(Math.Floor)}"] = "floor", + [$"{typeof(Math).FullName}.Clamp"] = "clamp", + [$"{typeof(Math).FullName}.{nameof(Math.Exp)}"] = "exp", + [$"{typeof(Math).FullName}.{nameof(Math.Log)}"] = "log", + [$"{typeof(Math).FullName}.{nameof(Math.Log10)}"] = "log10", + [$"{typeof(Math).FullName}.{nameof(Math.Round)}"] = "round", + [$"{typeof(Math).FullName}.{nameof(Math.Sqrt)}"] = "sqrt", + [$"{typeof(Math).FullName}.{nameof(Math.Sign)}"] = "sign", + [$"{typeof(Math).FullName}.{nameof(Math.Truncate)}"] = "trunc", + + ["System.MathF.Abs"] = "abs", + ["System.MathF.Max"] = "max", + ["System.MathF.Min"] = "min", + ["System.MathF.Pow"] = "pow", + ["System.MathF.Sin"] = "sin", + ["System.MathF.Sinh"] = "sinh", + ["System.MathF.Asin"] = "asin", + ["System.MathF.Cos"] = "cos", + ["System.MathF.Cosh"] = "cosh", + ["System.MathF.Acos"] = "acos", + ["System.MathF.Tan"] = "tan", + ["System.MathF.Tanh"] = "tanh", + ["System.MathF.Atan"] = "atan", + ["System.MathF.Atan2"] = "atan2", + ["System.MathF.Ceiling"] = "ceil", + ["System.MathF.Floor"] = "floor", + ["System.MathF.Clamp"] = "clamp", + ["System.MathF.Exp"] = "exp", + ["System.MathF.Log"] = "log", + ["System.MathF.Log10"] = "log10", + ["System.MathF.Round"] = "round", + ["System.MathF.Sqrt"] = "sqrt", + ["System.MathF.Sign"] = "sign", + ["System.MathF.Truncate"] = "trunc", + + [$"{typeof(float).FullName}.IsFinite"] = "isfinite", + [$"{typeof(float).FullName}.{nameof(float.IsInfinity)}"] = "isinf", + [$"{typeof(float).FullName}.{nameof(float.IsNaN)}"] = "isnan", + + [$"{typeof(double).FullName}.IsFinite"] = "isfinite", + [$"{typeof(double).FullName}.{nameof(double.IsInfinity)}"] = "isinf", + [$"{typeof(double).FullName}.{nameof(double.IsNaN)}"] = "isnan", + + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Dot)}"] = "dot", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Lerp)}"] = "lerp", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Transform)}"] = "mul", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.TransformNormal)}"] = "mul", + [$"{typeof(Vector2).FullName}.{nameof(Vector2.Normalize)}"] = "normalize", + + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Cross)}"] = "cross", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Dot)}"] = "dot", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Lerp)}"] = "lerp", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Transform)}"] = "mul", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.TransformNormal)}"] = "mul", + [$"{typeof(Vector3).FullName}.{nameof(Vector3.Normalize)}"] = "normalize", + + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Lerp)}"] = "lerp", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Transform)}"] = "mul", + [$"{typeof(Vector4).FullName}.{nameof(Vector4.Normalize)}"] = "normalize" + }; + + // Programmatically load mappings from the Hlsl class as well + foreach (var method in + from method in typeof(Hlsl).GetMethods(BindingFlags.Public | BindingFlags.Static) + group method by method.Name + into groups + select groups.First()) + { + // Check whether the current method should be translated with the original name + // or with the lowercase version. This is needed because all C# methods are exposed + // with the upper camel case format, while HLSL intrinsics use multiple different formats. + string hlslName = method.GetCustomAttribute()?.Name ?? method.Name; + + knownMethods.Add($"{typeof(Hlsl).FullName}{Type.Delimiter}{method.Name}", hlslName); + } + + return knownMethods; + } + + /// + /// Tries to get the mapped HLSL-compatible method name for the input method name. + /// + /// The input fully qualified method name. + /// The mapped name, if one is found. + /// The HLSL-compatible member name that can be used in an HLSL shader. + [Pure] + public static bool TryGetMappedName(string name, out string? mapped) + { + return KnownMethods.TryGetValue(name, out mapped); + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownSizes.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownSizes.cs new file mode 100644 index 00000000..78d2aed8 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownSizes.cs @@ -0,0 +1,62 @@ +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Numerics; +using System.Reflection; +using System.Text.RegularExpressions; + +namespace ComputeSharp.SourceGenerators.Mappings +{ + /// + /// A that contains and maps known HLSL types to their alignment sizes. + /// + internal static class HlslKnownSizes + { + /// + /// The mapping of supported known sizes to HLSL type names. + /// + private static IReadOnlyDictionary KnownSizes = BuildKnownSizesMap(); + + /// + /// Builds the mapping of known type sizes and alignments. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownSizesMap() + { + Dictionary knownSizes = new() + { + [typeof(bool).FullName] = (4, 4), + [typeof(int).FullName] = (4, 4), + [typeof(int).FullName] = (4, 4), + [typeof(float).FullName] = (4, 4), + [typeof(double).FullName] = (8, 8), + + [typeof(Vector2).FullName] = (8, 4), + [typeof(Vector3).FullName] = (12, 4), + [typeof(Vector4).FullName] = (16, 4) + }; + + foreach ( + var type in + from type in Assembly.GetExecutingAssembly().ExportedTypes + where Regex.IsMatch(type.FullName, @"^ComputeSharp\.(Bool|Double|Float|Int|UInt)") + select type) + { + knownSizes.Add(type.FullName, (type.StructLayoutAttribute.Size, type.StructLayoutAttribute.Pack)); + } + + return knownSizes; + } + + /// + /// Gets the size and alignment info for a specified primitive type. + /// + /// The type name to get info for. + /// The size and and alignment for the input type. + [Pure] + public static (int Size, int Pack) GetTypeInfo(string typeName) + { + return KnownSizes[typeName]; + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs new file mode 100644 index 00000000..2f686b1c --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs @@ -0,0 +1,378 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Numerics; +using System.Text.RegularExpressions; +using ComputeSharp.SourceGenerators.Extensions; +using Microsoft.CodeAnalysis; + +namespace ComputeSharp.SourceGenerators.Mappings +{ + /// + /// A that contains and maps known HLSL type names to common .NET types. + /// + internal static class HlslKnownTypes + { + /// + /// Gets the known HLSL dispatch types. + /// + public static IReadOnlyCollection HlslDispatchTypes { get; } = new[] + { + typeof(ThreadIds), + typeof(GroupIds), + typeof(WarpIds) + }; + + /// + /// Gets the set of HLSL vector types. + /// + public static IReadOnlyCollection KnownVectorTypes { get; } = new[] + { + typeof(Bool2), typeof(Bool3), typeof(Bool4), + typeof(Int2), typeof(Int3), typeof(Int4), + typeof(UInt2), typeof(UInt3), typeof(UInt4), + typeof(Float2), typeof(Float3), typeof(Float4), + typeof(Double2), typeof(Double3), typeof(Double4) + }; + + /// + /// Gets the set of HLSL matrix types. + /// + public static IReadOnlyCollection KnownMatrixTypes { get; } = new[] + { + typeof(Bool1x1), typeof(Bool1x2), typeof(Bool1x3), typeof(Bool1x4), + typeof(Bool2x1), typeof(Bool2x2), typeof(Bool2x3), typeof(Bool2x4), + typeof(Bool3x1), typeof(Bool3x2), typeof(Bool3x3), typeof(Bool3x4), + typeof(Bool4x1), typeof(Bool4x2), typeof(Bool4x3), typeof(Bool4x4), + typeof(Int1x1), typeof(Int1x2), typeof(Int1x3), typeof(Int1x4), + typeof(Int2x1), typeof(Int2x2), typeof(Int2x3), typeof(Int2x4), + typeof(Int3x1), typeof(Int3x2), typeof(Int3x3), typeof(Int3x4), + typeof(Int4x1), typeof(Int4x2), typeof(Int4x3), typeof(Int4x4), + typeof(UInt1x1), typeof(UInt1x2), typeof(UInt1x3), typeof(UInt1x4), + typeof(UInt2x1), typeof(UInt2x2), typeof(UInt2x3), typeof(UInt2x4), + typeof(UInt3x1), typeof(UInt3x2), typeof(UInt3x3), typeof(UInt3x4), + typeof(UInt4x1), typeof(UInt4x2), typeof(UInt4x3), typeof(UInt4x4), + typeof(Float1x1), typeof(Float1x2), typeof(Float1x3), typeof(Float1x4), + typeof(Float2x1), typeof(Float2x2), typeof(Float2x3), typeof(Float2x4), + typeof(Float3x1), typeof(Float3x2), typeof(Float3x3), typeof(Float3x4), + typeof(Float4x1), typeof(Float4x2), typeof(Float4x3), typeof(Float4x4), + typeof(Double1x1), typeof(Double1x2), typeof(Double1x3), typeof(Double1x4), + typeof(Double2x1), typeof(Double2x2), typeof(Double2x3), typeof(Double2x4), + typeof(Double3x1), typeof(Double3x2), typeof(Double3x3), typeof(Double3x4), + typeof(Double4x1), typeof(Double4x2), typeof(Double4x3), typeof(Double4x4) + }; + + /// + /// The mapping of supported known types to HLSL types. + /// + private static readonly IReadOnlyDictionary KnownHlslTypes = BuildKnownHlslTypes(); + + /// + /// Builds the mapping of known primitive types. + /// + [Pure] + private static IReadOnlyDictionary BuildKnownHlslTypes() + { + Dictionary knownTypes = new() + { + [typeof(bool).FullName] = "bool", + [typeof(int).FullName] = "int", + [typeof(uint).FullName] = "uint", + [typeof(float).FullName] = "float", + [typeof(Vector2).FullName] = "float2", + [typeof(Vector3).FullName] = "float3", + [typeof(Vector4).FullName] = "float4", + [typeof(double).FullName] = "double" + }; + + // Add all the vector types + foreach (var type in KnownVectorTypes) + { + knownTypes.Add(type.FullName, type.Name.ToLower()); + } + + // Add all the matrix types + foreach (var type in KnownMatrixTypes) + { + knownTypes.Add(type.FullName, type.Name.ToLower()); + } + + return knownTypes; + } + + /// + /// Checks whether or not a given type name matches a structured buffer type. + /// + /// The input type name to check. + /// Whether or not represents a structured buffer type. + public static bool IsStructuredBufferType(string typeName) + { + switch (typeName) + { + case "ComputeSharp.ConstantBuffer`1": + case "ComputeSharp.ReadOnlyBuffer`1": + case "ComputeSharp.ReadWriteBuffer`1": + return true; + default: return false; + }; + } + + /// + /// Checks whether or not a given type name matches a typed resource type. + /// + /// The input type name to check. + /// Whether or not represents a typed resource type. + public static bool IsTypedResourceType(string typeName) + { + switch (typeName) + { + case "ComputeSharp.ConstantBuffer`1": + case "ComputeSharp.ReadOnlyBuffer`1": + case "ComputeSharp.ReadWriteBuffer`1": + case "ComputeSharp.ReadOnlyTexture2D`1": + case "ComputeSharp.ReadOnlyTexture2D`2": + case "ComputeSharp.ReadWriteTexture2D`1": + case "ComputeSharp.ReadWriteTexture2D`2": + case "ComputeSharp.ReadOnlyTexture3D`1": + case "ComputeSharp.ReadOnlyTexture3D`2": + case "ComputeSharp.ReadWriteTexture3D`1": + case "ComputeSharp.ReadWriteTexture3D`2": + case "ComputeSharp.IReadOnlyTexture2D`1": + case "ComputeSharp.IReadWriteTexture2D`1": + case "ComputeSharp.IReadOnlyTexture3D`1": + case "ComputeSharp.IReadWriteTexture3D`1": + return true; + default: return false; + }; + } + + /// + /// Checks whether or not a given type name matches a known HLSL primitive type (scalar, vector or matrix). + /// + /// The input type name to check. + /// Whether or not represents a scalar, vector or matrix type. + public static bool IsKnownHlslType(string typeName) + { + return KnownHlslTypes.ContainsKey(typeName); + } + + /// + /// Checks whether or not a given type name matches a vector type. + /// + /// The input type name to check. + /// Whether or not represents a vector type. + public static bool IsVectorType(string typeName) + { + return KnownVectorTypes.Any(type => type.FullName == typeName); + } + + /// + /// Checks whether or not a given type name matches a matrix type. + /// + /// The input type name to check. + /// Whether or not represents a matrix type. + public static bool IsMatrixType(string typeName) + { + return KnownMatrixTypes.Any(type => type.FullName == typeName); + } + + /// + /// Checks whether or not a given type name is a non linear matrix type. + /// That is, a matrix type with more than a single row (which affects the constant buffer alignment). + /// + /// The input type name to check. + /// The element name of the matrix type. + /// The number of rows in the matrix type. + /// The number of columns in the matrix type. + /// Whether or not represents a non linear matrix type. + public static bool IsNonLinearMatrixType(string typeName, out string? elementName, out int rows, out int columns) + { + if (KnownMatrixTypes.Any(type => type.FullName == typeName)) + { + var match = Regex.Match(typeName, @"^ComputeSharp\.(Bool|Int|UInt|Float|Double)([2-4])x([1-4])$"); + + if (match.Success) + { + elementName = match.Groups[1].Value; + rows = int.Parse(match.Groups[2].Value); + columns = int.Parse(match.Groups[3].Value); + + return true; + } + } + + elementName = null; + rows = columns = 0; + + return false; + } + + /// + /// Gets the mapped HLSL-compatible type name for the input type symbol. + /// + /// The input type to map. + /// The HLSL-compatible type name that can be used in an HLSL shader. + [Pure] + public static string GetMappedName(INamedTypeSymbol typeSymbol) + { + // Delegate types just return an empty string, as they're not actually + // used in the generated shaders, but just mapped to a function at runtime. + if (typeSymbol.TypeKind == TypeKind.Delegate) return ""; + + string typeName = typeSymbol.GetFullMetadataName(); + + // Special case for the structured buffer types + if (IsTypedResourceType(typeName)) + { + string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments.Last()).GetFullMetadataName(); + + // If the current type is a custom type, format it as needed + if (!KnownHlslTypes.TryGetValue(genericArgumentName, out string? mapped)) + { + mapped = genericArgumentName.Replace(".", "__"); + } + + // Construct the HLSL type name + return typeName switch + { + "ComputeSharp.ConstantBuffer`1" => mapped, + "ComputeSharp.ReadOnlyBuffer`1" => $"StructuredBuffer<{mapped}>", + "ComputeSharp.ReadWriteBuffer`1" => $"RWStructuredBuffer<{mapped}>", + "ComputeSharp.ReadOnlyTexture2D`1" => $"Texture2D<{mapped}>", + "ComputeSharp.ReadOnlyTexture2D`2" => $"Texture2D", + "ComputeSharp.ReadWriteTexture2D`1" => $"RWTexture2D<{mapped}>", + "ComputeSharp.ReadWriteTexture2D`2" => $"RWTexture2D", + "ComputeSharp.ReadOnlyTexture3D`1" => $"Texture3D<{mapped}>", + "ComputeSharp.ReadOnlyTexture3D`2" => $"Texture3D", + "ComputeSharp.ReadWriteTexture3D`1" => $"RWTexture3D<{mapped}>", + "ComputeSharp.ReadWriteTexture3D`2" => $"RWTexture3D", + "ComputeSharp.IReadOnlyTexture2D`1" => $"Texture2D", + "ComputeSharp.IReadWriteTexture2D`1" => $"RWTexture2D", + "ComputeSharp.IReadOnlyTexture3D`1" => $"Texture3D", + "ComputeSharp.IReadWriteTexture3D`1" => $"RWTexture3D", + _ => throw new ArgumentException() + }; + } + + return KnownHlslTypes[typeName]; + } + + /// + /// Gets the mapped HLSL-compatible type name for the input element type symbol. + /// + /// The input type to map. + /// The HLSL-compatible type name that can be used in an HLSL shader. + [Pure] + public static string GetMappedElementName(IArrayTypeSymbol typeSymbol) + { + string elementTypeName = ((INamedTypeSymbol)typeSymbol.ElementType).GetFullMetadataName(); + + if (KnownHlslTypes.TryGetValue(elementTypeName, out string? mapped)) + { + return mapped; + } + + return elementTypeName.Replace(".", "__"); + } + + /// + /// Gets the mapped HLSL-compatible type name for the input type name. + /// + /// The input type name to map. + /// The HLSL-compatible type name that can be used in an HLSL shader. + public static bool TryGetMappedName(string originalName, out string? mappedName) + { + return KnownHlslTypes.TryGetValue(originalName, out mappedName); + } + + /// + /// Gets the sequence of unique custom types from a collection of discovered types. + /// + /// The input collection of discovered types. + /// The list of unique custom types. + public static IEnumerable GetCustomTypes(IEnumerable discoveredTypes) + { + // Local function to recursively gather nested types + static void ExploreTypes(INamedTypeSymbol type, HashSet customTypes) + { + if (KnownHlslTypes.ContainsKey(type.GetFullMetadataName())) return; + + if (!customTypes.Add(type)) return; + + foreach (var field in type.GetMembers().OfType()) + { + if (field.IsStatic) continue; + + ExploreTypes((INamedTypeSymbol)field.Type, customTypes); + } + } + + HashSet customTypes = new(SymbolEqualityComparer.Default); + + // Explore all input types and their nested types + foreach (INamedTypeSymbol type in discoveredTypes) + { + ExploreTypes(type, customTypes); + } + + return OrderByDependency(customTypes); + } + + /// + /// Orders the input sequence of types so that they can be declared in HLSL successfully. + /// + /// The input collection of types to declare. + /// The same list as input, but in a valid HLSL declaration order. + [Pure] + private static IEnumerable OrderByDependency(IEnumerable types) + { + Queue<(INamedTypeSymbol Type, HashSet Fields)> queue = new(); + + // Build a mapping of type dependencies for all the captured types. A type depends on another + // when the latter is a field in the first type. HLSL requires custom types to be declared in + // order of usage, so we need to ensure that types are declared in an order that guarantees + // that no type will be referenced before being defined. To do so, we can create a mapping of + // types and their dependencies, and iteratively remove items from the map when they have no + // dependencies left. When one type is processed and removed, it is also removed from the list + // of dependencies of all other remaining types in the map, until there is none left. + foreach (var type in types) + { + HashSet dependencies = new(SymbolEqualityComparer.Default); + + // Only add other custom types as dependencies, and ignore HLSL types + foreach (var field in type.GetMembers().OfType()) + { + if (field.IsStatic) continue; + + INamedTypeSymbol fieldType = (INamedTypeSymbol)field.Type; + + if (!KnownHlslTypes.ContainsKey(fieldType.GetFullMetadataName())) + { + _ = dependencies.Add(fieldType); + } + } + + queue.Enqueue((type, dependencies)); + } + + while (queue.Count > 0) + { + var entry = queue.Dequeue(); + + // No dependencies left, we can declare this type + if (entry.Fields.Count == 0) + { + // Remove the current type from dependencies of others + foreach (var pair in queue) + { + _ = pair.Fields.Remove(entry.Type); + } + + yield return entry.Type; + } + else queue.Enqueue(entry); + } + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs new file mode 100644 index 00000000..6939758f --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/ShaderMethodSourceGenerator.cs @@ -0,0 +1,137 @@ +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Text; +using ComputeSharp.__Internals; +using ComputeSharp.SourceGenerators.Diagnostics; +using ComputeSharp.SourceGenerators.Extensions; +using ComputeSharp.SourceGenerators.SyntaxRewriters; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; +using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; +using static ComputeSharp.SourceGenerators.Helpers.SyntaxFactoryHelper; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +#pragma warning disable CS0618 + +namespace ComputeSharp.SourceGenerators +{ + [Generator] + public class ShaderMethodSourceGenerator : ISourceGenerator + { + /// + public void Initialize(GeneratorInitializationContext context) + { + } + + /// + public void Execute(GeneratorExecutionContext context) + { + // Find all the [ShaderMethod] usages and retrieve the target methods + ImmutableArray methods = ( + from tree in context.Compilation.SyntaxTrees + from attribute in tree.GetRoot().DescendantNodes().OfType() + let symbol = context.Compilation.GetSemanticModel(attribute.SyntaxTree) + let typeInfo = symbol.GetTypeInfo(attribute) + where typeInfo.Type is { Name: nameof(ShaderMethodAttribute) } + select attribute.FirstAncestorOrSelf()).ToImmutableArray(); + + foreach (MethodDeclarationSyntax methodDeclaration in methods) + { + SemanticModel semanticModel = context.Compilation.GetSemanticModel(methodDeclaration.SyntaxTree); + IMethodSymbol methodDeclarationSymbol = semanticModel.GetDeclaredSymbol(methodDeclaration)!; + + try + { + OnExecute(context, methodDeclaration, semanticModel, methodDeclarationSymbol); + } + catch + { + context.ReportDiagnostic(ShaderMethodSourceGeneratorError, methodDeclaration, methodDeclarationSymbol); + } + } + } + + /// + /// Processes a given target method. + /// + /// The input instance to use. + /// The node to process. + /// The with metadata on the types being processed. + /// The for . + private static void OnExecute(GeneratorExecutionContext context, MethodDeclarationSyntax methodDeclaration, SemanticModel semanticModel, IMethodSymbol methodDeclarationSymbol) + { + // We need to sets to track all discovered custom types and static methods + HashSet discoveredTypes = new(SymbolEqualityComparer.Default); + Dictionary staticMethods = new(SymbolEqualityComparer.Default); + Dictionary constantDefinitions = new(SymbolEqualityComparer.Default); + + // Explore the syntax tree and extract the processed info + var (invokeMethod, processedMethods) = GetProcessedMethods(context, methodDeclaration, semanticModel, discoveredTypes, staticMethods, constantDefinitions); + var processedTypes = IComputeShaderSourceGenerator.GetProcessedTypes(discoveredTypes).ToArray(); + var processedConstants = IComputeShaderSourceGenerator.GetProcessedConstants(constantDefinitions); + + // Create the compilation unit with the source attribute + var source = + CompilationUnit().AddAttributeLists( + AttributeList(SingletonSeparatedList( + Attribute(IdentifierName(typeof(ShaderMethodSourceAttribute).FullName)).AddArgumentListArguments( + AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(methodDeclarationSymbol.GetFullMetadataName(true)))), + AttributeArgument(ArrayExpression(processedTypes)), + AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(invokeMethod))), + AttributeArgument(ArrayExpression(processedMethods)), + AttributeArgument(NestedArrayExpression(processedConstants))))) + .WithOpenBracketToken(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.OpenBracketToken, TriviaList())) + .WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword)))) + .NormalizeWhitespace() + .ToFullString(); + + // Add the method source attribute + context.AddSource(methodDeclarationSymbol.GetGeneratedFileName(), SourceText.From(source, Encoding.UTF8)); + } + + /// + /// Gets a sequence of processed methods from a target method declaration. + /// + /// The current generator context in use. + /// The instance for the current method. + /// The instance for the method to process. + /// The collection of currently discovered types. + /// The set of discovered and processed static methods. + /// The collection of discovered constant definitions. + /// A sequence of processed methods in . + [Pure] + private static (string InvokeMethod, IEnumerable Methods) GetProcessedMethods( + GeneratorExecutionContext context, + MethodDeclarationSyntax methodDeclaration, + SemanticModel semanticModel, + ICollection discoveredTypes, + IDictionary staticMethods, + IDictionary constantDefinitions) + { + ShaderSourceRewriter shaderSourceRewriter = new(semanticModel, discoveredTypes, staticMethods, constantDefinitions, context); + + // Rewrite the method syntax tree + var processedMethod = shaderSourceRewriter + .Visit(methodDeclaration)! + .WithIdentifier(Identifier(ShaderMethodSourceAttribute.InvokeMethodIdentifier)) + .WithoutTrivia() + .NormalizeWhitespace() + .ToFullString(); + + List methods = new(shaderSourceRewriter.LocalFunctions.Count); + + // Emit the extracted local functions + foreach (var localFunction in shaderSourceRewriter.LocalFunctions) + { + methods.Add(localFunction.Value.NormalizeWhitespace().ToFullString()); + } + + return (processedMethod, methods); + } + } +} + diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ExecuteMethodRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ExecuteMethodRewriter.cs new file mode 100644 index 00000000..ad67c0b3 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ExecuteMethodRewriter.cs @@ -0,0 +1,99 @@ +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace ComputeSharp.SourceGenerators.SyntaxRewriters +{ + /// + /// A custom type that does postprocessing fixups on the shader main method. + /// + internal sealed class ExecuteMethodRewriter : CSharpSyntaxRewriter + { + /// + /// The instance used to process the input tree. + /// + private readonly ShaderSourceRewriter shaderSourceRewriter; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance used to process the input tree. + public ExecuteMethodRewriter(ShaderSourceRewriter shaderSourceRewriter) + { + this.shaderSourceRewriter = shaderSourceRewriter; + } + + /// + public TNode? Visit(TNode? node) + where TNode : SyntaxNode + { + return (TNode?)base.Visit(node); + } + + /// + public override SyntaxNode? VisitParameterList(ParameterListSyntax node) + { + var updatedNode = (ParameterListSyntax)base.VisitParameterList(node)!; + + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(ThreadIds)} : SV_DispatchThreadID"))); + + if (this.shaderSourceRewriter.IsGroupIdsUsed) + { + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(GroupIds)} : SV_GroupThreadID"))); + } + + if (this.shaderSourceRewriter.IsGroupIdsIndexUsed) + { + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint __{nameof(GroupIds)}__get_Index : SV_GroupIndex"))); + } + + if (this.shaderSourceRewriter.IsWarpIdsUsed) + { + updatedNode = updatedNode.AddParameters(Parameter(Identifier($"uint3 {nameof(WarpIds)} : SV_GroupID"))); + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) + { + var updatedNode = ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!).WithModifiers(TokenList()); + + // When we're rewriting the main compute shader method, we need to insert a range + // check to ensure that invocation outside of the requested range are discarded. + // The following snippet creates this prologue before the user provided body: + // + // if (ThreadIds.x < __x && + // ThreadIds.y < __y && + // ThreadIds.z < __z) + // { + // + // } + var rangeCheckExpression = + BinaryExpression(SyntaxKind.LogicalAndExpression, + BinaryExpression(SyntaxKind.LogicalAndExpression, + BinaryExpression(SyntaxKind.LessThanExpression, + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nameof(ThreadIds)), + IdentifierName("x")), + IdentifierName("__x")), + BinaryExpression(SyntaxKind.LessThanExpression, + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nameof(ThreadIds)), + IdentifierName("y")), + IdentifierName("__y"))), + BinaryExpression(SyntaxKind.LessThanExpression, + MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName(nameof(ThreadIds)), + IdentifierName("z")), + IdentifierName("__z"))); + + return updatedNode.WithBody(Block(IfStatement(rangeCheckExpression, updatedNode.Body!))); + } + } +} diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs new file mode 100644 index 00000000..a36f9e92 --- /dev/null +++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs @@ -0,0 +1,902 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using ComputeSharp.SourceGenerators.Diagnostics; +using ComputeSharp.SourceGenerators.Extensions; +using ComputeSharp.SourceGenerators.Mappings; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Operations; +using static ComputeSharp.SourceGenerators.Diagnostics.DiagnosticDescriptors; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; + +namespace ComputeSharp.SourceGenerators.SyntaxRewriters +{ + /// + /// A custom type that processes C# methods to convert to HLSL compliant code. + /// + internal sealed class ShaderSourceRewriter : CSharpSyntaxRewriter + { + /// + /// The type symbol for the shader type. + /// + private readonly INamedTypeSymbol? shaderType; + + /// + /// The instance with semantic info on the target syntax tree. + /// + private readonly SemanticModel semanticModel; + + /// + /// The collection of discovered custom types. + /// + private readonly ICollection discoveredTypes; + + /// + /// The collection of discovered static methods. + /// + private readonly IDictionary staticMethods; + + /// + /// The collection of discovered constant definitions. + /// + private readonly IDictionary constantDefinitions; + + /// + /// The collection of processed local functions in the current tree. + /// + private readonly Dictionary localFunctions; + + /// + /// The list of implicit variables to declare at the start of the body. + /// + private readonly List implicitVariables; + + /// + /// The current generator context in use. + /// + private readonly GeneratorExecutionContext context; + + /// + /// Whether or not the current instance is processing a shader entry point. + /// + private readonly bool isEntryPoint; + + /// + /// The current tree being visited. + /// + private MethodDeclarationSyntax? currentMethod; + + /// + /// The current depth inside local declarations. + /// + private int localFunctionDepth; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The type symbol for the shader type. + /// The instance for the target syntax tree. + /// The set of discovered custom types. + /// The set of discovered and processed static methods. + /// The collection of discovered constant definitions. + /// The current generator context in use. + /// Whether or not the current instance is processing a shader entry point. + public ShaderSourceRewriter( + INamedTypeSymbol shaderType, + SemanticModel semanticModel, + ICollection discoveredTypes, + IDictionary staticMethods, + IDictionary constantDefinitions, + GeneratorExecutionContext context, + bool isEntryPoint) + { + this.shaderType = shaderType; + this.semanticModel = semanticModel; + this.discoveredTypes = discoveredTypes; + this.staticMethods = staticMethods; + this.constantDefinitions = constantDefinitions; + this.localFunctions = new(); + this.implicitVariables = new(); + this.context = context; + this.isEntryPoint = isEntryPoint; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance for the target syntax tree. + /// The set of discovered custom types. + /// The set of discovered and processed static methods. + /// The collection of discovered constant definitions. + /// The current generator context in use. + public ShaderSourceRewriter( + SemanticModel semanticModel, + ICollection discoveredTypes, + IDictionary staticMethods, + IDictionary constantDefinitions, + GeneratorExecutionContext context) + { + this.semanticModel = semanticModel; + this.discoveredTypes = discoveredTypes; + this.staticMethods = staticMethods; + this.constantDefinitions = constantDefinitions; + this.implicitVariables = new(); + this.localFunctions = new(); + this.context = context; + } + + /// + /// Gets the collection of processed local functions in the current tree. + /// + public IReadOnlyDictionary LocalFunctions => this.localFunctions; + + /// + /// Gets whether or not the shader uses at least once (except ). + /// + public bool IsGroupIdsUsed { get; private set; } + + /// + /// Gets whether or not the shader uses at least once. + /// + public bool IsWarpIdsUsed { get; set; } + + /// + public MethodDeclarationSyntax? Visit(MethodDeclarationSyntax? node) + { + this.currentMethod = node; + + var updatedNode = (MethodDeclarationSyntax?)base.Visit(node)!; + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, this.semanticModel, this.discoveredTypes); + + if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) + { + this.context.ReportDiagnostic(AsyncModifierOnMethodOrFunction, node); + } + + if (node!.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) + { + this.context.ReportDiagnostic(UnsafeModifierOnMethodOrFunction, node); + } + + if (updatedNode is not null) + { + var implicitBlock = Block(this.implicitVariables.Select(static v => LocalDeclarationStatement(v)).ToArray()); + + // Add the tracked implicit declarations (at the start of the body) + updatedNode = updatedNode.WithBody(implicitBlock).AddBodyStatements(updatedNode.Body!.Statements.ToArray()); + } + + return updatedNode; + } + + /// + public override SyntaxNode VisitParameter(ParameterSyntax node) + { + var updatedNode = (ParameterSyntax)base.VisitParameter(node)!; + + // Convert the C# parameter modifiers to the HLSL equivalent + SyntaxToken modifier = + node.Modifiers + .Where(static m => m.Kind() is SyntaxKind.OutKeyword or SyntaxKind.RefKeyword or SyntaxKind.InKeyword) + .Select(static m => m.Kind() switch + { + SyntaxKind.OutKeyword => m, + SyntaxKind.InKeyword => m, + SyntaxKind.RefKeyword => ParseToken("inout"), + _ => Token(SyntaxKind.None) + }).FirstOrDefault(); + + return updatedNode + .WithAttributeLists(default) + .ReplaceAndTrackType(updatedNode.Type!, node.Type!, this.semanticModel, this.discoveredTypes) + .WithModifiers(TokenList(modifier)); + } + + /// + public override SyntaxNode VisitCastExpression(CastExpressionSyntax node) + { + var updatedNode = (CastExpressionSyntax)base.VisitCastExpression(node)!; + + return updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, this.semanticModel, this.discoveredTypes); + } + + /// + public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node) + { + var updatedNode = ((LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node)!); + + if (this.semanticModel.GetOperation(node) is IOperation { Kind: OperationKind.UsingDeclaration }) + { + this.context.ReportDiagnostic(UsingStatementOrDeclaration, node); + } + + return updatedNode.ReplaceAndTrackType(updatedNode.Declaration.Type, node.Declaration.Type, this.semanticModel, this.discoveredTypes); + } + + /// + public override SyntaxNode VisitObjectCreationExpression(ObjectCreationExpressionSyntax node) + { + var updatedNode = (ObjectCreationExpressionSyntax)base.VisitObjectCreationExpression(node)!; + + if (this.semanticModel.GetTypeInfo(node).Type is ITypeSymbol { IsUnmanagedType: false } type) + { + this.context.ReportDiagnostic(InvalidObjectCreationExpression, node, type); + } + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node, this.semanticModel, this.discoveredTypes); + + // New objects use the default HLSL cast syntax, eg. (float4)0 + if (updatedNode.ArgumentList!.Arguments.Count == 0) + { + return CastExpression(updatedNode.Type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + } + + // Add explicit casts for matrix constructors to help the overload resolution + if (this.semanticModel.GetTypeInfo(node).Type is ITypeSymbol matrixType && + HlslKnownTypes.IsMatrixType(matrixType.GetFullMetadataName())) + { + for (int i = 0; i < node.ArgumentList!.Arguments.Count; i++) + { + IArgumentOperation argumentOperation = (IArgumentOperation)this.semanticModel.GetOperation(node.ArgumentList.Arguments[i])!; + INamedTypeSymbol elementType = (INamedTypeSymbol)argumentOperation.Parameter.Type; + + updatedNode = updatedNode.ReplaceNode( + updatedNode.ArgumentList!.Arguments[i].Expression, + CastExpression(IdentifierName(HlslKnownTypes.GetMappedName(elementType)), updatedNode.ArgumentList.Arguments[i].Expression)); + } + } + + return InvocationExpression(updatedNode.Type, updatedNode.ArgumentList!); + } + + /// + public override SyntaxNode? VisitAnonymousObjectCreationExpression(AnonymousObjectCreationExpressionSyntax node) + { + var updatedNode = (AnonymousObjectCreationExpressionSyntax)base.VisitAnonymousObjectCreationExpression(node)!; + + this.context.ReportDiagnostic(DiagnosticDescriptors.AnonymousObjectCreationExpression, node); + + return updatedNode; + } + + /// + public override SyntaxNode VisitImplicitObjectCreationExpression(ImplicitObjectCreationExpressionSyntax node) + { + var updatedNode = (ImplicitObjectCreationExpressionSyntax)base.VisitImplicitObjectCreationExpression(node)!; + + if (this.semanticModel.GetTypeInfo(node).Type is ITypeSymbol { IsUnmanagedType: false } type) + { + this.context.ReportDiagnostic(InvalidObjectCreationExpression, node, type); + } + + TypeSyntax explicitType = IdentifierName("").ReplaceAndTrackType(node, this.semanticModel, this.discoveredTypes); + + // Mutate the syntax like with explicit object creation expressions + if (updatedNode.ArgumentList!.Arguments.Count == 0) + { + return CastExpression(explicitType, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + } + + // Add explicit casts like with the explicit object creation expressions above + if (this.semanticModel.GetTypeInfo(node).Type is ITypeSymbol matrixType && + HlslKnownTypes.IsMatrixType(matrixType.GetFullMetadataName())) + { + for (int i = 0; i < node.ArgumentList.Arguments.Count; i++) + { + IArgumentOperation argumentOperation = (IArgumentOperation)this.semanticModel.GetOperation(node.ArgumentList.Arguments[i])!; + INamedTypeSymbol elementType = (INamedTypeSymbol)argumentOperation.Parameter.Type; + + updatedNode = updatedNode.ReplaceNode( + updatedNode.ArgumentList.Arguments[i].Expression, + CastExpression(IdentifierName(HlslKnownTypes.GetMappedName(elementType)), updatedNode.ArgumentList.Arguments[i].Expression)); + } + } + + return InvocationExpression(explicitType, updatedNode.ArgumentList); + } + + /// + public override SyntaxNode VisitDefaultExpression(DefaultExpressionSyntax node) + { + var updatedNode = (DefaultExpressionSyntax)base.VisitDefaultExpression(node)!; + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, this.semanticModel, this.discoveredTypes); + + // A default expression becomes (T)0 in HLSL + return CastExpression(updatedNode.Type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + } + + /// + public override SyntaxNode? VisitLiteralExpression(LiteralExpressionSyntax node) + { + var updatedNode = (LiteralExpressionSyntax)base.VisitLiteralExpression(node)!; + + if (updatedNode.IsKind(SyntaxKind.DefaultLiteralExpression)) + { + TypeSyntax type = node.TrackType(this.semanticModel, this.discoveredTypes); + + // Same HLSL-style expression in the form (T)0 + return CastExpression(type, LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))); + } + else if (updatedNode.IsKind(SyntaxKind.NumericLiteralExpression) && + this.semanticModel.GetOperation(node) is ILiteralOperation operation && + operation.Type is INamedTypeSymbol type) + { + // If the expression is a literal floating point value, we need to ensure the proper suffixes are + // used in the HLSL representation. Floating point values accept either f or F, but they don't work + // when the literal doesn't contain a decimal point. Since 32 bit floating point values are the default + // in HLSL, we can remove the suffix entirely. As for 64 bit values, we simply use the 'L' suffix. + if (type.GetFullMetadataName().Equals(typeof(float).FullName)) + { + string literal = updatedNode.Token.ValueText; + + if (!literal.Contains('.')) literal += ".0"; + + return updatedNode.WithToken(Literal(literal, 0f)); + } + else if (type.GetFullMetadataName().Equals(typeof(double).FullName)) + { + return updatedNode.WithToken(Literal(updatedNode.Token.ValueText + "L", 0d)); + } + } + else if (updatedNode.IsKind(SyntaxKind.StringLiteralExpression)) + { + this.context.ReportDiagnostic(StringLiteralExpression, node); + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitDeclarationExpression(DeclarationExpressionSyntax node) + { + var updatedNode = (DeclarationExpressionSyntax)base.VisitDeclarationExpression(node)!; + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.Type, node.Type, this.semanticModel, this.discoveredTypes); + + // Add the variable to the list of implicit declarations + this.implicitVariables.Add(VariableDeclaration(updatedNode.Type).AddVariables(VariableDeclarator(updatedNode.Designation.ToString()))); + + return IdentifierName(updatedNode.Designation.ToString()); + } + + /// + public override SyntaxNode? VisitMethodDeclaration(MethodDeclarationSyntax node) + { + return + ((MethodDeclarationSyntax)base.VisitMethodDeclaration(node)!) + .WithBlockBody() + .WithoutAccessibilityModifiers() + .WithAttributeLists(List()); + } + + /// + public override SyntaxNode? VisitLocalFunctionStatement(LocalFunctionStatementSyntax node) + { + this.localFunctionDepth++; + + var updatedNode = + ((LocalFunctionStatementSyntax)base.VisitLocalFunctionStatement(node)!) + .WithBlockBody() + .WithAttributeLists(List()) + .WithIdentifier(Identifier($"__{this.currentMethod!.Identifier.Text}__{node.Identifier.Text}")); + + updatedNode = updatedNode.ReplaceAndTrackType(updatedNode.ReturnType, node!.ReturnType, this.semanticModel, this.discoveredTypes); + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.AsyncKeyword))) + { + this.context.ReportDiagnostic(AsyncModifierOnMethodOrFunction, node); + } + + if (node.Modifiers.Any(m => m.IsKind(SyntaxKind.UnsafeKeyword))) + { + this.context.ReportDiagnostic(UnsafeModifierOnMethodOrFunction, node); + } + + this.localFunctionDepth--; + + // HLSL doesn't support local functions, so we first process them as usual and then remove + // them from the current syntax tree completely. These will be added to the shader source + // as external static method with a special name to avoid conflicts with other methods. + // The name will simply be in the format: "____". + this.localFunctions.Add(updatedNode.Identifier.Text, updatedNode); + + return null; + } + + /// + public override SyntaxNode VisitMemberAccessExpression(MemberAccessExpressionSyntax node) + { + var updatedNode = (MemberAccessExpressionSyntax)base.VisitMemberAccessExpression(node)!; + + if (node.IsKind(SyntaxKind.SimpleMemberAccessExpression) && + this.semanticModel.GetOperation(node) is IMemberReferenceOperation operation) + { + // If the member access is a constant, track it and replace the tree with the processed constant name + if (operation is IFieldReferenceOperation fieldOperation && + fieldOperation.Field.IsConst && + fieldOperation.Type.TypeKind != TypeKind.Enum) + { + this.constantDefinitions[fieldOperation.Field] = ((IFormattable)fieldOperation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); + + var ownerTypeName = ((INamedTypeSymbol)fieldOperation.Field.ContainingSymbol).ToDisplayString().Replace(".", "__"); + var constantName = $"__{ownerTypeName}__{fieldOperation.Field.Name}"; + + return IdentifierName(constantName); + } + + // If the current member access is a field or property access, check the lookup table + // to see if the member should be rewritten for HLSL compliance, and rewrite if needed. + if (HlslKnownMembers.TryGetMappedName(operation.Member.ToDisplayString(), out string? mapping)) + { + // Mark which dispatch properties have been used, to optimize the declaration afterwards + if (operation.Member.IsStatic) + { + string typeName = operation.Member.ContainingType.GetFullMetadataName(); + + if (mapping == $"__{nameof(GroupIds)}__get_Index") IsGroupIdsIndexUsed = true; + else if (typeName == typeof(GroupIds).FullName) IsGroupIdsUsed = true; + else if (typeName == typeof(WarpIds).FullName) IsWarpIdsUsed = true; + + // Check that the dispatch info types are only used from the main shader body + if (!this.isEntryPoint || this.localFunctionDepth > 0) + { + DiagnosticDescriptor? descriptor = typeName switch + { + _ when typeName == typeof(ThreadIds).FullName => DiagnosticDescriptors.InvalidThreadIdsUsage, + _ when typeName == typeof(GroupIds).FullName => DiagnosticDescriptors.InvalidGroupIdsUsage, + _ when typeName == typeof(GroupSize).FullName => DiagnosticDescriptors.InvalidGroupSizeUsage, + _ when typeName == typeof(WarpIds).FullName => DiagnosticDescriptors.InvalidWarpIdsUsage, + _ => null + }; + + if (descriptor is not null) + { + this.context.ReportDiagnostic(descriptor, node); + } + } + } + + // Static and instance members are handled differently, with static members being + // converted into a literal expression, and instance getting an updated identifier. + // For instance, consider these three cases: + // - Vector3.One (static) => float3(1.0f, 1.0f, 1.0f) + // - ThreadIds.X (custom) => ThreadIds.x + // - uint3.X (instance) => [arg].x + return operation.Member.IsStatic switch + { + true => ParseExpression(mapping!), + false => updatedNode.WithName(IdentifierName(mapping!)) + }; + } + + // If the current member access is an access to any of the size properties in the available + // resource types (either buffer or texture types), then rewrite the subtree to transform the + // property access into an invocation of an autogenerated static helper method to get the target + // dimension for the buffer in use. The helper method is added to the list of static helpers. + if (operation is IPropertyReferenceOperation propertyOperation && + HlslKnownMembers.TryGetAccessorRankAndAxis(propertyOperation.Property.GetFullMetadataName(), out int rank, out int axis)) + { + IMethodSymbol key = propertyOperation.Property.GetMethod!; + + if (!this.staticMethods.TryGetValue(key, out MethodDeclarationSyntax? methodSyntax)) + { + INamedTypeSymbol resourceType = (INamedTypeSymbol)this.semanticModel.GetTypeInfo(node.Expression).Type!; + string resourceName = HlslKnownTypes.GetMappedName(resourceType); + + // Create a static method to get a specified dimension for a target resource type. + // The method will automatically create the necessary number of temporary variables + // depending on the rank of the input resource (eg. 2 for Texture2D resources). + // For instance, this code will generate the following tree for Texture2D.Width: + // + // static int __get_Dimension0(Texture2D texture) + // { + // uint _0, _1; + // texture.GetDimensions(_0, _1); + // + // return _0; + // } + methodSyntax = + MethodDeclaration(PredefinedType(Token(SyntaxKind.IntKeyword)), $"__get_Dimension{axis}") + .AddModifiers(Token(SyntaxKind.StaticKeyword)) + .AddParameterListParameters( + Parameter(Identifier("resource")) + .WithType(IdentifierName(resourceName))) + .WithBody(Block( + LocalDeclarationStatement( + VariableDeclaration(PredefinedType(Token(SyntaxKind.UIntKeyword))) + .AddVariables(Enumerable.Range(0, rank).Select(static i => VariableDeclarator(Identifier("_" + i))).ToArray())), + ExpressionStatement( + InvocationExpression(MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + IdentifierName("resource"), + IdentifierName("GetDimensions"))) + .AddArgumentListArguments(Enumerable.Range(0, rank).Select(static i => Argument(IdentifierName("_" + i))).ToArray())), + ReturnStatement(IdentifierName("_" + axis)))); + + this.staticMethods.Add(key, methodSyntax); + } + + return InvocationExpression(IdentifierName(methodSyntax.Identifier)).AddArgumentListArguments(Argument(updatedNode.Expression)); + } + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitInvocationExpression(InvocationExpressionSyntax node) + { + var updatedNode = (InvocationExpressionSyntax)base.VisitInvocationExpression(node)!; + + if (this.semanticModel.GetOperation(node) is IInvocationOperation operation && + operation.TargetMethod is IMethodSymbol method && + method.IsStatic) + { + // If the invocation consists of invoking a static method that has a direct + // mapping to HLSL, rewrite the expression in the current invocation node. + // For instance: Math.Abs(expr) => abs(expr). + if (HlslKnownMethods.TryGetMappedName(method.GetFullMetadataName(), out string? mapping)) + { + return updatedNode.WithExpression(ParseExpression(mapping!)); + } + + // Update the name if the target is a local function. The exact schema for the + // updated name is detailed in the override handling the local function statement. + if (method.MethodKind == MethodKind.LocalFunction) + { + var functionIdentifier = $"__{this.currentMethod!.Identifier.Text}__{method.Name}"; + + return updatedNode.WithExpression(ParseExpression(functionIdentifier)); + } + + // If the method is an external static method, import and rewrite it as well. + // This assumes that the target method is actually part of the same compilation. + // We need to check the declaring type to avoid rewriting static methods in the shader + // type as well, as they will be processed by the generator in a different path. + if (!SymbolEqualityComparer.Default.Equals(this.shaderType, method.ContainingType)) + { + var methodIdentifier = method.GetFullMetadataName().Replace(".", "__"); + + if (!this.staticMethods.ContainsKey(method)) + { + ShaderSourceRewriter shaderSourceRewriter = new(this.semanticModel, this.discoveredTypes, this.staticMethods, this.constantDefinitions, this.context); + MethodDeclarationSyntax + methodNode = (MethodDeclarationSyntax)method.DeclaringSyntaxReferences[0].GetSyntax(), + processedMethod = shaderSourceRewriter.Visit(methodNode)!.NormalizeWhitespace().WithoutTrivia(); + + this.staticMethods.Add(method, processedMethod.WithIdentifier(Identifier(methodIdentifier))); + } + + return updatedNode.WithExpression(ParseExpression(methodIdentifier)); + } + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitElementAccessExpression(ElementAccessExpressionSyntax node) + { + var updatedNode = (ElementAccessExpressionSyntax)base.VisitElementAccessExpression(node)!; + + if (this.semanticModel.GetOperation(node) is IPropertyReferenceOperation operation) + { + string propertyName = operation.Property.GetFullMetadataName(); + + // Rewrite texture resource indices taking vectors into individual indices as per HLSL spec. + // For instance: texture[ThreadIds.XY] will be rewritten as texture[ThreadIds.X, ThreadIds.Y]. + if (HlslKnownMembers.TryGetMappedResourceIndexerTypeName(propertyName, out string? mapping)) + { + var index = InvocationExpression(IdentifierName(mapping!), ArgumentList(updatedNode.ArgumentList.Arguments)); + + return updatedNode.WithArgumentList(BracketedArgumentList(SingletonSeparatedList(Argument(index)))); + } + + // If the current property is a swizzled matrix indexer, ensure all the arguments are constants, and rewrite + // the property access to the corresponding HLSL syntax. For instance, m[M11, M12] will become m._m00_m01. + if (HlslKnownMembers.IsKnownMatrixIndexer(propertyName)) + { + bool isValid = true; + + // Validate the arguments + foreach (ArgumentSyntax argument in node.ArgumentList.Arguments) + { + if (this.semanticModel.GetOperation(argument.Expression) is not IFieldReferenceOperation fieldReference || + !HlslKnownMembers.IsKnownMatrixIndex(fieldReference.Field.GetFullMetadataName())) + { + this.context.ReportDiagnostic(NonConstantMatrixSwizzledIndex, argument); + + isValid = false; + } + } + + if (isValid) + { + // Rewrite the indexer as a property access + string hlslPropertyName = string.Join("", + from argument in node.ArgumentList.Arguments + let fieldReference = (IFieldReferenceOperation)this.semanticModel.GetOperation(argument.Expression)! + let fieldName = fieldReference.Field.Name + let row = (char)(fieldName[1] - 1) + let column = (char)(fieldName[2] - 1) + select $"_m{row}{column}"); + + return MemberAccessExpression( + SyntaxKind.SimpleMemberAccessExpression, + updatedNode.Expression, + IdentifierName(hlslPropertyName)); + } + } + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitArgument(ArgumentSyntax node) + { + var updatedNode = (ArgumentSyntax)base.VisitArgument(node)!; + + // Strip the ref keywords from arguments + updatedNode = updatedNode.WithRefKindKeyword(Token(SyntaxKind.None)); + + // Track and rewrite the discarded declaration + if (this.semanticModel.GetOperation(node.Expression) is IDiscardOperation operation) + { + TypeSyntax typeSyntax = operation.Type!.TrackType(this.discoveredTypes); + string identifier = $"__implicit{this.implicitVariables.Count}"; + + // Add the variable to the list of implicit declarations + this.implicitVariables.Add(VariableDeclaration(typeSyntax).AddVariables(VariableDeclarator(identifier))); + + return updatedNode.WithExpression(IdentifierName(identifier)); + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitIdentifierName(IdentifierNameSyntax node) + { + var updatedNode = (IdentifierNameSyntax)base.VisitIdentifierName(node)!; + + if (this.semanticModel.GetOperation(node) is IFieldReferenceOperation operation && + operation.Field.IsConst && + operation.Type.TypeKind != TypeKind.Enum) + { + this.constantDefinitions[operation.Field] = ((IFormattable)operation.Field.ConstantValue!).ToString(null, CultureInfo.InvariantCulture); + + var ownerTypeName = ((INamedTypeSymbol)operation.Field.ContainingSymbol).ToDisplayString().Replace(".", "__"); + var constantName = $"__{ownerTypeName}__{operation.Field.Name}"; + + return IdentifierName(constantName); + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitAwaitExpression(AwaitExpressionSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.AwaitExpression, node); + + return base.VisitAwaitExpression(node); + } + + /// + public override SyntaxNode? VisitCheckedExpression(CheckedExpressionSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.CheckedExpression, node); + + return base.VisitCheckedExpression(node); + } + + /// + public override SyntaxNode? VisitCheckedStatement(CheckedStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.CheckedStatement, node); + + return base.VisitCheckedStatement(node); + } + + /// + public override SyntaxNode? VisitFixedStatement(FixedStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.FixedStatement, node); + + return base.VisitFixedStatement(node); + } + + /// + public override SyntaxNode? VisitForEachStatement(ForEachStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.ForEachStatement, node); + + return base.VisitForEachStatement(node); + } + + /// + public override SyntaxNode? VisitForEachVariableStatement(ForEachVariableStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.ForEachStatement, node); + + return base.VisitForEachVariableStatement(node); + } + + /// + public override SyntaxNode? VisitLockStatement(LockStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.LockStatement, node); + + return base.VisitLockStatement(node); + } + + /// + public override SyntaxNode? VisitQueryExpression(QueryExpressionSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.QueryExpression, node); + + return base.VisitQueryExpression(node); + } + + /// + public override SyntaxNode? VisitRangeExpression(RangeExpressionSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.RangeExpression, node); + + return base.VisitRangeExpression(node); + } + + /// + public override SyntaxNode? VisitRecursivePattern(RecursivePatternSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.RecursivePattern, node); + + return base.VisitRecursivePattern(node); + } + + /// + public override SyntaxNode? VisitRefType(RefTypeSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.RefType, node); + + return base.VisitRefType(node); + } + + /// + public override SyntaxNode? VisitRelationalPattern(RelationalPatternSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.RelationalPattern, node); + + return base.VisitRelationalPattern(node); + } + + /// + public override SyntaxNode? VisitSizeOfExpression(SizeOfExpressionSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.SizeOfExpression, node); + + return base.VisitSizeOfExpression(node); + } + + /// + public override SyntaxNode? VisitStackAllocArrayCreationExpression(StackAllocArrayCreationExpressionSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.StackAllocArrayCreationExpression, node); + + return base.VisitStackAllocArrayCreationExpression(node); + } + + /// + public override SyntaxNode? VisitThrowExpression(ThrowExpressionSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.ThrowExpressionOrStatement, node); + + return base.VisitThrowExpression(node); + } + + /// + public override SyntaxNode? VisitThrowStatement(ThrowStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.ThrowExpressionOrStatement, node); + + return base.VisitThrowStatement(node); + } + + /// + public override SyntaxNode? VisitTryStatement(TryStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.TryStatement, node); + + return base.VisitTryStatement(node); + } + + /// + public override SyntaxNode? VisitTupleType(TupleTypeSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.TupleType, node); + + return base.VisitTupleType(node); + } + + /// + public override SyntaxNode? VisitUsingStatement(UsingStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.UsingStatementOrDeclaration, node); + + return base.VisitUsingStatement(node); + } + + /// + public override SyntaxNode? VisitVariableDeclarator(VariableDeclaratorSyntax node) + { + var updatedNode = (VariableDeclaratorSyntax)base.VisitVariableDeclarator(node)!; + + if (node.Initializer is null && + node.Parent is VariableDeclarationSyntax declaration && + this.semanticModel.GetTypeInfo(declaration.Type).Type is ITypeSymbol { IsUnmanagedType: false } type) + { + this.context.ReportDiagnostic(InvalidObjectDeclaration, node, type); + } + + return updatedNode; + } + + /// + public override SyntaxNode? VisitYieldStatement(YieldStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.YieldStatement, node); + + return base.VisitYieldStatement(node); + } + + /// + public override SyntaxNode? VisitFunctionPointerType(FunctionPointerTypeSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.FunctionPointer, node); + + return base.VisitFunctionPointerType(node); + } + + /// + public override SyntaxNode? VisitPointerType(PointerTypeSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.PointerType, node); + + return base.VisitPointerType(node); + } + + /// + public override SyntaxNode? VisitUnsafeStatement(UnsafeStatementSyntax node) + { + this.context.ReportDiagnostic(DiagnosticDescriptors.UnsafeStatement, node); + + return base.VisitUnsafeStatement(node); + } + + /// + public override SyntaxToken VisitToken(SyntaxToken token) + { + SyntaxToken updatedToken = base.VisitToken(token); + + // Replace all identifier tokens when needed, to avoid colliding with HLSL keywords + if (updatedToken.IsKind(SyntaxKind.IdentifierToken) && + HlslKnownKeywords.TryGetMappedName(updatedToken.Text, out string? mapped)) + { + return ParseToken(mapped!); + } + + return updatedToken.WithoutTrivia(); + } + } +} diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj index aa1d99a3..2119803e 100644 --- a/src/ComputeSharp/ComputeSharp.csproj +++ b/src/ComputeSharp/ComputeSharp.csproj @@ -1,17 +1,228 @@  - netstandard2.1 - 8.0 - enable + net5.0 + bin\Release + ComputeSharp.xml + ComputeSharp - + + + - + + + + + + + + + + + True + True + Hlsl.tt + + + True + True + Bool2.tt + + + True + True + Bool3.tt + + + True + True + Bool4.tt + + + True + True + BoolMxN.tt + + + True + True + Double2.tt + + + True + True + Double3.tt + + + True + True + Double4.tt + + + True + True + DoubleMxN.tt + + + True + True + Float2.tt + + + True + True + Float3.tt + + + True + True + Float4.tt + + + True + True + FloatMxN.tt + + + True + True + Int2.tt + + + True + True + Int3.tt + + + True + True + Int4.tt + + + True + True + IntMxN.tt + + + True + True + UInt2.tt + + + True + True + UInt3.tt + + + True + True + UInt4.tt + + + True + True + UIntMxN.tt + + + + + + TextTemplatingFileGenerator + Hlsl.g.cs + + + TextTemplatingFileGenerator + Bool2.g.cs + + + TextTemplatingFileGenerator + Bool3.g.cs + + + TextTemplatingFileGenerator + Bool4.g.cs + + + TextTemplatingFileGenerator + BoolMxN.g.cs + + + TextTemplatingFileGenerator + Double2.g.cs + + + TextTemplatingFileGenerator + Double3.g.cs + + + TextTemplatingFileGenerator + Double4.g.cs + + + TextTemplatingFileGenerator + DoubleMxN.g.cs + + + TextTemplatingFileGenerator + Float2.g.cs + + + TextTemplatingFileGenerator + Float3.g.cs + + + TextTemplatingFileGenerator + Float4.g.cs + + + TextTemplatingFileGenerator + FloatMxN.g.cs + + + TextTemplatingFileGenerator + Int2.g.cs + + + TextTemplatingFileGenerator + Int3.g.cs + + + TextTemplatingFileGenerator + Int4.g.cs + + + TextTemplatingFileGenerator + IntMxN.g.cs + + + TextTemplatingFileGenerator + UInt2.g.cs + + + TextTemplatingFileGenerator + UInt3.g.cs + + + TextTemplatingFileGenerator + UInt4.g.cs + + + TextTemplatingFileGenerator + UIntMxN.g.cs + diff --git a/src/ComputeSharp/ComputeSharp.nuspec b/src/ComputeSharp/ComputeSharp.nuspec deleted file mode 100644 index 3f708d4d..00000000 --- a/src/ComputeSharp/ComputeSharp.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - ComputeSharp - 1.4.1 - ComputeSharp - Sergio Pedri - Sergio Pedri - MIT - https://github.com/Sergio0694/ComputeSharp - https://i.imgur.com/ntvmD6P.png - false - A .NET Standard 2.1 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders - New interlocked intrinsics APIs, performance and memory optimizations - Copyright (c) 2020 Sergio Pedri - dotnet net netcore netstandard csharp library graphics shader hlsl compute gpu - - - - - - - - - - - - diff --git a/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs b/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs new file mode 100644 index 00000000..c5db9978 --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/AutoConstructorAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace ComputeSharp +{ + /// + /// An attribute that indicates that a target shader type should get an automatic constructor for all fields. + /// + [AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] + public sealed class AutoConstructorAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs b/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs new file mode 100644 index 00000000..06f561ba --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/GroupSharedAttribute.cs @@ -0,0 +1,46 @@ +using System; + +namespace ComputeSharp +{ + /// + /// An attribute that indicates that an array static field in a shader type will be shared in a thread group. + /// + /// This attribute can be used to declare fields as follows: + /// + /// struct MyShader : IComputeShader + /// { + /// [GroupShared(32)] + /// static float[] MyBuffer; + /// } + /// + /// + /// The buffer shouldn't be manually initialized, as each shader invocation will automatically receive the + /// right buffer in use for the thread group it belongs to. If there is an assignment for the field, it + /// will just be ignored in the shader. Additionally, buffer types are not allowed as array items. + /// + [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] + public sealed class GroupSharedAttribute : Attribute + { + /// + /// Creates a new instance with the specified parameters. + /// + public GroupSharedAttribute() + { + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The size of the shared buffer to declare. + public GroupSharedAttribute(int size) + { + Size = size; + } + + /// + /// Gets the size of the shared buffer being declared. + /// If , the thread group size will be used. + /// + public int? Size { get; } + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/ShaderMethodAttribute.cs b/src/ComputeSharp/Core/Attributes/ShaderMethodAttribute.cs new file mode 100644 index 00000000..d644045c --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/ShaderMethodAttribute.cs @@ -0,0 +1,16 @@ +using System; + +namespace ComputeSharp +{ + /// + /// An attribute that indicates that a method will be indirectly used in a compute shader. + /// This method is necessary for methods that are captured and used within a given shader + /// through a field (of some custom type). In order to be processed + /// correctly, wrapped methods need to have this attribute manually applied to them. + /// Methods also need to be static, though this can only be tested at runtime. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public sealed class ShaderMethodAttribute : Attribute + { + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/__Internals/ComputeRoot32BitConstantsAttribute.cs b/src/ComputeSharp/Core/Attributes/__Internals/ComputeRoot32BitConstantsAttribute.cs new file mode 100644 index 00000000..3277c05b --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/__Internals/ComputeRoot32BitConstantsAttribute.cs @@ -0,0 +1,29 @@ +using System; +using System.ComponentModel; + +namespace ComputeSharp.__Internals +{ + /// + /// An attribute that contains info on the number of 32 bit constants for a given shader. + /// + /// This attribute is not meant to be directly used by applications using ComputeSharp. + [AttributeUsage(AttributeTargets.ReturnValue, AllowMultiple = false)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This attribute is not intended to be used directly by user code")] + public sealed class ComputeRoot32BitConstantsAttribute : Attribute + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The number of 32 bit constants for the annotated method. + public ComputeRoot32BitConstantsAttribute(int count) + { + Count = count; + } + + /// + /// Gets the number of 32 bit constants for the annotated method. + /// + internal int Count { get; } + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/__Internals/IComputeShaderSourceAttribute.cs b/src/ComputeSharp/Core/Attributes/__Internals/IComputeShaderSourceAttribute.cs new file mode 100644 index 00000000..b9f62c79 --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/__Internals/IComputeShaderSourceAttribute.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; + +namespace ComputeSharp.__Internals +{ + /// + /// An attribute that contains info on a processed compute shader that can be executed. + /// + /// This attribute is not meant to be directly used by applications using ComputeSharp. + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This attribute is not intended to be used directly by user code")] + public sealed class IComputeShaderSourceAttribute : Attribute + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The type of the current shader. + /// The collection of custom types. + /// The mapped collection of shader fields. + /// The source code for the method. + /// The collection of processed methods. + /// The collection of discovered constants. + /// The collection of group shared buffers. + public IComputeShaderSourceAttribute( + Type shaderType, + string[] types, + object[] args, + string executeMethod, + string[] methods, + object[] constants, + object[] sharedBuffers) + { + ShaderType = shaderType; + Types = types; + Fields = args.Cast().ToDictionary(static arg => arg[0], static arg => (arg[1], arg[2])); + ExecuteMethod = executeMethod; + Methods = methods; + Constants = constants.Cast().ToDictionary(static c => c[0], static c => c[1]); + SharedBuffers = sharedBuffers.Cast().ToDictionary(static t => (string)t[0], static t => ((string)t[1], (int?)t[2])); + } + + /// + /// Gets the type of the current shader. + /// + internal Type ShaderType { get; } + + /// + /// Gets the collection of processed custom types. + /// + internal IReadOnlyCollection Types { get; } + + /// + /// Gets the mapping of field names. + /// + internal IReadOnlyDictionary Fields { get; } + + /// + /// Gets the source code for the method. + /// + internal string ExecuteMethod { get; } + + /// + /// Gets the collection of processed methods. + /// + internal IReadOnlyCollection Methods { get; } + + /// + /// Gets the collection of discovered constants. + /// + internal IReadOnlyDictionary Constants { get; } + + /// + /// Gets the collection of discovered constants. + /// + internal IReadOnlyDictionary SharedBuffers { get; } + + /// + /// Gets the associated instance for a specified type. + /// + /// The shader type to get the attribute for. + /// The associated instance for type . + [Pure] + internal static IComputeShaderSourceAttribute GetForType() + { + Type shaderType = typeof(T); + + return shaderType.Assembly.GetCustomAttributes().Single(attribute => attribute.ShaderType == shaderType); + } + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.cs b/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.cs new file mode 100644 index 00000000..8d0bbce3 --- /dev/null +++ b/src/ComputeSharp/Core/Attributes/__Internals/ShaderMethodSourceAttribute.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Exceptions; + +namespace ComputeSharp.__Internals +{ + /// + /// An attribute that contains info on a processed shader method that can be executed within a shader. + /// Instances of this attribute are generated from method annotated with . + /// + /// This attribute is not meant to be directly used by applications using ComputeSharp. + [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This attribute is not intended to be used directly by user code")] + public sealed class ShaderMethodSourceAttribute : Attribute + { + /// + /// The identifier for the invoke method, for late binding. + /// + internal const string InvokeMethodIdentifier = "____"; + + /// + /// The source code for the target entry point method. + /// + private readonly string invokeMethod; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The fully qualified name of the current method. + /// The collection of custom types. + /// The source code for the target entry point method. + /// The collection of processed methods. + /// The collection of discovered constants. + public ShaderMethodSourceAttribute(string methodName, string[] types, string invokeMethod, string[] methods, object[] constants) + { + this.invokeMethod = invokeMethod; + + MethodName = methodName; + Types = types; + Methods = methods; + Constants = constants.Cast().ToDictionary(static c => c[0], static c => c[1]); + } + + /// + /// Gets the fully qualified name of the shader type. + /// + internal string MethodName { get; } + + /// + /// Gets the collection of processed custom types. + /// + internal IReadOnlyCollection Types { get; } + + /// + /// Gets the collection of processed methods. + /// + internal IReadOnlyCollection Methods { get; } + + /// + /// Gets the collection of discovered constants. + /// + internal IReadOnlyDictionary Constants { get; } + + /// + /// Gets the mapped source code for the current method. + /// + /// The name to bind the method to. + /// The mapped source code for the current mehtod. + [Pure] + internal string GetMappedInvokeMethod(string name) + { + return this.invokeMethod.Replace(InvokeMethodIdentifier, name); + } + + /// + /// Gets the associated instance for a specified delegate. + /// + /// The input instance to get info for. + /// The associated instance for the given delegate. + [Pure] + internal static ShaderMethodSourceAttribute GetForDelegate(Delegate function) + { + if (!function.Method.IsStatic) + { + ThrowArgumentExceptionForNonStaticShader(); + } + + var attributes = function.Method.DeclaringType!.Assembly.GetCustomAttributes(); + string methodName = function.Method.GetFullName(); + + foreach (var attribute in attributes) + { + if (attribute.MethodName.Equals(methodName)) + { + return attribute; + } + } + + return MissingMethodSourceException.Throw(function); + } + + /// + /// Throws an when a given is not static. + /// + private static void ThrowArgumentExceptionForNonStaticShader() + { + throw new ArgumentException("Captured delegates in a shader need to wrap a static method.", "function"); + } + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Core/Dispatch/GroupIds.cs b/src/ComputeSharp/Core/Dispatch/GroupIds.cs new file mode 100644 index 00000000..18473a80 --- /dev/null +++ b/src/ComputeSharp/Core/Dispatch/GroupIds.cs @@ -0,0 +1,210 @@ +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that indicates the ids of a given GPU thread running a compute shader within a dispatch group. + /// + public static class GroupIds + { + /// + /// Gets the flattened index of the current thread with respect to the dispatch group. + /// + public static int Index => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(Index)}"); + + /// + /// Gets the X id of the current thread with respect to the dispatch group. + /// + public static int X => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(X)}"); + + /// + /// Gets the Y id of the current thread with respect to the dispatch group. + /// + public static int Y => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(Y)}"); + + /// + /// Gets the Z id of the current thread with respect to the dispatch group. + /// + public static int Z => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(Z)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZZ)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XYY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XZX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(XZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YXY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YYX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YYZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(YZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZXX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZXZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{nameof(GroupIds)}.{nameof(ZZZ)}"); + } +} diff --git a/src/ComputeSharp/Core/Dispatch/GroupSize.cs b/src/ComputeSharp/Core/Dispatch/GroupSize.cs new file mode 100644 index 00000000..0b4973c8 --- /dev/null +++ b/src/ComputeSharp/Core/Dispatch/GroupSize.cs @@ -0,0 +1,210 @@ +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that indicates the size info of a given GPU thread group running a compute shader within. + /// + public static class GroupSize + { + /// + /// Gets the total size of the current thread group. + /// + public static int Count => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(Count)}"); + + /// + /// Gets the size of the X axis of the current thread group. + /// + public static int X => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(X)}"); + + /// + /// Gets the size of the Y axis of the current thread group. + /// + public static int Y => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(Y)}"); + + /// + /// Gets the size of the Z axis of the current thread group. + /// + public static int Z => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(Z)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZZ)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XYY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XZX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(XZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YXY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YYX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YYZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(YZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZXX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZXZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{nameof(GroupSize)}.{nameof(ZZZ)}"); + } +} diff --git a/src/ComputeSharp/Core/Dispatch/ThreadIds.cs b/src/ComputeSharp/Core/Dispatch/ThreadIds.cs new file mode 100644 index 00000000..175d5f5a --- /dev/null +++ b/src/ComputeSharp/Core/Dispatch/ThreadIds.cs @@ -0,0 +1,205 @@ +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that indicates the ids of a given GPU thread running a compute shader. + /// + public static class ThreadIds + { + /// + /// Gets the X id of the current thread. + /// + public static int X => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(X)}"); + + /// + /// Gets the Y id of the current thread. + /// + public static int Y => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(Y)}"); + + /// + /// Gets the Z id of the current thread. + /// + public static int Z => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(Z)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZZ)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XYY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XZX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(XZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YXY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YYX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YYZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(YZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZXX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZXZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{nameof(ThreadIds)}.{nameof(ZZZ)}"); + } +} diff --git a/src/ComputeSharp/Core/Dispatch/WarpIds.cs b/src/ComputeSharp/Core/Dispatch/WarpIds.cs new file mode 100644 index 00000000..2c02cdbb --- /dev/null +++ b/src/ComputeSharp/Core/Dispatch/WarpIds.cs @@ -0,0 +1,205 @@ +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that indicates the ids of a given dispatch warp (a group of threads). + /// + public static class WarpIds + { + /// + /// Gets the X id of the current thread with respect to the dispatch group. + /// + public static int X => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(X)}"); + + /// + /// Gets the Y id of the current thread with respect to the dispatch group. + /// + public static int Y => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(Y)}"); + + /// + /// Gets the Z id of the current thread with respect to the dispatch group. + /// + public static int Z => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(Z)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 XX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 XZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 YY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YY)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 YZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YZ)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZX)}"); + + /// + /// Gets or sets an value with the and values. + /// + public static Int2 ZY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZZ)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 XXX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XXZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XYY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XYY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XYZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XZX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 XZY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 XZZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(XZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YXX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YXY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YXY)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YXZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YXZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YYX)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 YYY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YYZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YYZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 YZX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YZY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 YZZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(YZZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZXX)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZXY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZXY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZXZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZXZ)}"); + + /// + /// Gets or sets an value with the , and values. + /// + public static Int3 ZYX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZYX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZYY)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZYZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZYZ)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZX => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZZX)}"); + + /// + /// Gets an value with the , and values. + /// + public static Int3 ZZY => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZZY)}"); + + /// + /// Gets an value with the value for all components. + /// + public static Int3 ZZZ => throw new InvalidExecutionContextException($"{nameof(WarpIds)}.{nameof(ZZZ)}"); + } +} diff --git a/src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs b/src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs similarity index 61% rename from src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs rename to src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs index 00a70c3e..dacf8db3 100644 --- a/src/ComputeSharp.Core/Exceptions/InvalidExecutionContextException.cs +++ b/src/ComputeSharp/Core/Exceptions/InvalidExecutionContextException.cs @@ -8,9 +8,12 @@ namespace ComputeSharp.Exceptions public sealed class InvalidExecutionContextException : InvalidOperationException { /// - /// Creates a new instance + /// Creates a new instance. /// - /// The name of the caller API - internal InvalidExecutionContextException(string name) : base($"The API {name} can only be used from within an HLSL shader") { } + /// The name of the caller API. + internal InvalidExecutionContextException(string name) + : base($"The API {name} can only be used from within an HLSL shader.") + { + } } } diff --git a/src/ComputeSharp/Core/Exceptions/MissingMethodSourceException.cs b/src/ComputeSharp/Core/Exceptions/MissingMethodSourceException.cs new file mode 100644 index 00000000..c31a043b --- /dev/null +++ b/src/ComputeSharp/Core/Exceptions/MissingMethodSourceException.cs @@ -0,0 +1,53 @@ +using System; +using System.Diagnostics.Contracts; +using System.Text; +using ComputeSharp.__Internals; +using ComputeSharp.Core.Extensions; + +#pragma warning disable CS0618 + +namespace ComputeSharp.Exceptions +{ + /// + /// A custom that indicates when an HLSL-only API is called from C# + /// + public sealed class MissingMethodSourceException : InvalidOperationException + { + /// + /// Creates a new instance. + /// + /// The exception message to display. + private MissingMethodSourceException(string message) + : base(message) + { + } + + /// + /// Creates a new instance from the specified parameters. + /// + /// The target that couldn't be processed. + /// A new instance with a formatted error message. + [Pure] + private static MissingMethodSourceException Create(Delegate method) + { + StringBuilder builder = new(512); + + builder.AppendLine("The processed source for a method captured as a delegate in a shader was not found."); + builder.AppendLine($"The delegate was of type {method.GetType()} and it was wrapping the method {method.Method.GetFullName()}."); + builder.Append($"Make sure that the target method is annotated with [{nameof(ShaderMethodAttribute)}]."); + builder.ToString(); + + return new(builder.ToString()); + } + + /// + /// Throws a new for a given delegate. + /// + /// The target that couldn't be processed. + /// This method always throws and never actually returns anything. + internal static ShaderMethodSourceAttribute Throw(Delegate method) + { + throw Create(method); + } + } +} diff --git a/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs new file mode 100644 index 00000000..b413e1b3 --- /dev/null +++ b/src/ComputeSharp/Core/Extensions/MethodInfoExtensions.cs @@ -0,0 +1,32 @@ +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; + +namespace ComputeSharp.Core.Extensions +{ + /// + /// A that provides extension methods for the type. + /// + internal static class MethodInfoExtensions + { + /// + /// Gets a fully qualified name for the input method, including parameters. + /// + /// The input instance. + /// A fully qualified name for , including parameters. + [Pure] + public static string GetFullName(this MethodInfo method) + { + var parameters = string.Join(", ", method.GetParameters().Select(static p => p.ParameterType.FullName)); + + if (method.IsGenericMethod) + { + var arguments = string.Join(", ", method.GetGenericArguments().Select(static t => t.FullName)); + + return $"{method.DeclaringType!.FullName}.{method.Name}<{arguments}>({parameters})"; + } + + return $"{method.DeclaringType!.FullName}.{method.Name}({parameters})"; + } + } +} diff --git a/src/ComputeSharp/Core/Helpers/AlignmentHelper.cs b/src/ComputeSharp/Core/Helpers/AlignmentHelper.cs new file mode 100644 index 00000000..20baf93f --- /dev/null +++ b/src/ComputeSharp/Core/Helpers/AlignmentHelper.cs @@ -0,0 +1,43 @@ +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; + +namespace ComputeSharp.Core.Helpers +{ + /// + /// A with helper methods to work with alignment and padding. + /// + internal static class AlignmentHelper + { + /// + /// Pads the input size so that its pitch is aligned to a multiple of a specified length. + /// + /// The input size to pad, if needed. + /// The target alignment. + /// The padded value relative to the given inputs. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Pad(int size, int alignment) + { + return (size + alignment - 1) & ~(alignment - 1); + } + + /// + /// Aligns a given offset to a specified boundary, if a given size increment would have crossed it. + /// + /// The starting offset to align, if needed. + /// The size increment to apply to . + /// The alignment boundary to calculate the final offset. + /// A valid starting offset for the specified alignment. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int AlignToBoundary(int offset, int size, int alignment) + { + if ((uint)offset / (uint)alignment == (uint)(offset + size - 1) / (uint)alignment) + { + return offset; + } + + return (offset + alignment - 1) & ~(alignment - 1); + } + } +} diff --git a/src/ComputeSharp.Core/Interfaces/IComputeShader.cs b/src/ComputeSharp/Core/Interfaces/IComputeShader.cs similarity index 65% rename from src/ComputeSharp.Core/Interfaces/IComputeShader.cs rename to src/ComputeSharp/Core/Interfaces/IComputeShader.cs index 66f145dd..37f5396d 100644 --- a/src/ComputeSharp.Core/Interfaces/IComputeShader.cs +++ b/src/ComputeSharp/Core/Interfaces/IComputeShader.cs @@ -8,7 +8,6 @@ /// /// Executes the current compute shader. /// - /// The value with the current execution indices. - void Execute(ThreadIds ids); + void Execute(); } } diff --git a/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs b/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs new file mode 100644 index 00000000..80e133e2 --- /dev/null +++ b/src/ComputeSharp/Core/Intrinsics/Attributes/HlslIntrinsicNameAttribute.cs @@ -0,0 +1,24 @@ +using System; + +namespace ComputeSharp.Core.Intrinsics.Attributes +{ + /// + /// An attribute indicating the native member name of a given HLSL intrinsic. + /// + internal sealed class HlslIntrinsicNameAttribute : Attribute + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The name of the HLSL intrinsic. + public HlslIntrinsicNameAttribute(string name) + { + Name = name; + } + + /// + /// Gets the name of the HLSL intrinsic. + /// + public string Name { get; } + } +} diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.cs b/src/ComputeSharp/Core/Intrinsics/Hlsl.cs new file mode 100644 index 00000000..868a6f2b --- /dev/null +++ b/src/ComputeSharp/Core/Intrinsics/Hlsl.cs @@ -0,0 +1,284 @@ +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the supported HLSL intrinsic functions that can be used in compute shaders. + /// + public static partial class Hlsl + { + /// + /// Blocks execution of all threads in a group until all memory accesses have been completed. + /// + /// + /// A memory barrier guarantees that outstanding memory operations have completed. + /// Threads are synchronized at GroupSync barriers. + /// This may stall a thread or threads if memory operations are in progress. + /// + public static void AllMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrier)}()"); + + /// + /// Blocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call. + /// + /// + /// A memory barrier guarantees that outstanding memory operations have completed. + /// Threads are synchronized at GroupSync barriers. + /// This may stall a thread or threads if memory operations are in progress. + /// + public static void AllMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrierWithGroupSync)}()"); + + /// + /// Blocks execution of all threads in a group until all device memory accesses have been completed. + /// + public static void DeviceMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrier)}()"); + + /// + /// Blocks execution of all threads in a group until all device memory accesses have been completed and all threads in the group have reached this call. + /// + public static void DeviceMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrierWithGroupSync)}()"); + + /// + /// Blocks execution of all threads in a group until all group shared accesses have been completed. + /// + public static void GroupMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrier)}()"); + + /// + /// Blocks execution of all threads in a group until all group shared accesses have been completed and all threads in the group have reached this call. + /// + public static void GroupMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrierWithGroupSync)}()"); + + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + public static void InterlockedAdd(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + public static void InterlockedAdd(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + public static void InterlockedAdd(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic add of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + public static void InterlockedAdd(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + public static void InterlockedAnd(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + public static void InterlockedAnd(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + public static void InterlockedAnd(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic and of a value to a destination. + /// + /// The destination value. + /// The input value. + /// The original input value. + public static void InterlockedAnd(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Atomically compares the destination with the comparison value. If they are identical, the destination + /// is overwritten with the input value. The original value is set to the destination's original value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + /// The original value. + public static void InterlockedCompareExchange(int destination, int comparison, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Atomically compares the destination with the comparison value. If they are identical, the destination + /// is overwritten with the input value. The original value is set to the destination's original value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + /// The original value. + public static void InterlockedCompareExchange(uint destination, uint comparison, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Atomically compares the destination to the comparison value. If they + /// are identical, the destination is overwritten with the input value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + public static void InterlockedCompareStore(int destination, int comparison, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Atomically compares the destination to the comparison value. If they + /// are identical, the destination is overwritten with the input value. + /// + /// The destination value. + /// The comparison value. + /// The input value. + public static void InterlockedCompareStore(uint destination, uint comparison, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Assigns value to dest and returns the original value. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedExchange(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Assigns value to dest and returns the original value. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedExchange(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + public static void InterlockedMax(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + public static void InterlockedMax(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedMax(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic max. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedMax(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + public static void InterlockedMin(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + public static void InterlockedMin(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedMin(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic min. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedMin(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + public static void InterlockedOr(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + public static void InterlockedOr(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedOr(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic or. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedOr(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + public static void InterlockedXor(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + public static void InterlockedXor(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)})"); + + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedXor(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Performs a guaranteed atomic xor. + /// + /// The destination value. + /// The input value. + /// The original value. + public static void InterlockedXor(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})"); + } +} diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs b/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs new file mode 100644 index 00000000..e029ee85 --- /dev/null +++ b/src/ComputeSharp/Core/Intrinsics/Hlsl.g.cs @@ -0,0 +1,15167 @@ +using System.Diagnostics.Contracts; +using ComputeSharp.Core.Intrinsics.Attributes; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + public static partial class Hlsl + { + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static int Abs(int x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(int)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2 Abs(Int2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3 Abs(Int3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4 Abs(Int4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x1 Abs(Int1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int1x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x2 Abs(Int1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int1x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x3 Abs(Int1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int1x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int1x4 Abs(Int1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int1x4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x1 Abs(Int2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int2x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x2 Abs(Int2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int2x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x3 Abs(Int2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int2x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int2x4 Abs(Int2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int2x4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x1 Abs(Int3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int3x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x2 Abs(Int3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int3x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x3 Abs(Int3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int3x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int3x4 Abs(Int3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int3x4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x1 Abs(Int4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int4x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x2 Abs(Int4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int4x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x3 Abs(Int4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int4x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Int4x4 Abs(Int4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Int4x4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static float Abs(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(float)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2 Abs(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3 Abs(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4 Abs(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x1 Abs(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float1x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x2 Abs(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float1x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x3 Abs(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float1x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float1x4 Abs(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float1x4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x1 Abs(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float2x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x2 Abs(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float2x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x3 Abs(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float2x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float2x4 Abs(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float2x4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x1 Abs(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float3x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x2 Abs(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float3x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x3 Abs(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float3x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float3x4 Abs(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float3x4)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x1 Abs(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float4x1)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x2 Abs(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float4x2)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x3 Abs(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float4x3)})"); + + /// + /// Returns the absolute value of the specified value. + /// + /// The specified value. + /// The absolute value of the parameter. + [Pure] + [HlslIntrinsicName("abs")] + public static Float4x4 Abs(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Abs)}({typeof(Float4x4)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static float Acos(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(float)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2 Acos(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float2)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3 Acos(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float3)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4 Acos(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float4)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x1 Acos(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float1x1)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x2 Acos(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float1x2)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x3 Acos(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float1x3)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float1x4 Acos(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float1x4)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x1 Acos(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float2x1)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x2 Acos(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float2x2)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x3 Acos(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float2x3)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float2x4 Acos(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float2x4)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x1 Acos(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float3x1)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x2 Acos(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float3x2)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x3 Acos(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float3x3)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float3x4 Acos(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float3x4)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x1 Acos(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float4x1)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x2 Acos(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float4x2)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x3 Acos(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float4x3)})"); + + /// + /// Returns the arccosine of the specified value. + /// + /// The specified value. Each component should be a floating-point within the range [-1, 1]. + /// The arccosine of the parameter. + [Pure] + [HlslIntrinsicName("acos")] + public static Float4x4 Acos(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Acos)}({typeof(Float4x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(int x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(int)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int1x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int1x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int1x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int1x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int2x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int2x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int2x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int2x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int3x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int3x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int3x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int3x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int4x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int4x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int4x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Int4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Int4x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(float)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float1x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float1x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float1x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float1x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float2x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float2x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float2x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float2x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float3x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float3x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float3x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float3x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float4x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float4x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float4x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Float4x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(bool x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(bool)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool1x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool1x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool1x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool1x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool2x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool2x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool2x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool2x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool3x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool3x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool3x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool3x4)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool4x1)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool4x2)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool4x3)})"); + + /// + /// Determines if all components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not all components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("all")] + public static bool All(Bool4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(All)}({typeof(Bool4x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(int x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(int)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int1x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int1x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int1x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int1x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int2x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int2x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int2x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int2x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int3x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int3x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int3x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int3x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int4x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int4x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int4x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Int4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Int4x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(float)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float1x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float1x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float1x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float1x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float2x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float2x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float2x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float2x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float3x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float3x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float3x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float3x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float4x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float4x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float4x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Float4x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(bool x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(bool)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool1x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool1x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool1x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool1x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool2x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool2x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool2x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool2x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool3x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool3x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool3x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool3x4)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool4x1)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool4x2)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool4x3)})"); + + /// + /// Determines if any components of the specified value are non-zero. + /// + /// The specified value. + /// Whether or not any components of the parameter are non-zero. + [Pure] + [HlslIntrinsicName("any")] + public static bool Any(Bool4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Any)}({typeof(Bool4x4)})"); + + /// + /// Reinterprets a cast value (two 32-bit values) into a double precision floating-point value. + /// + /// The low 32-bit pattern of the input value. + /// The high 32-bit pattern of the input value. + /// The input (two 32-bit values) recast as a double precision floating-point number. + [Pure] + [HlslIntrinsicName("asdouble")] + public static double AsDouble(uint lowbits, uint highbits) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsDouble)}({typeof(uint)}, {typeof(uint)})"); + + /// + /// Reinterprets a cast value (two 32-bit values) into a double precision floating-point value. + /// + /// The low 32-bit pattern of the input value. + /// The high 32-bit pattern of the input value. + /// The input (two 32-bit values) recast as a double precision floating-point number. + [Pure] + [HlslIntrinsicName("asdouble")] + public static Double2 AsDouble(UInt2 lowbits, UInt2 highbits) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsDouble)}({typeof(UInt2)}, {typeof(UInt2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static float AsFloat(int x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(int)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2 AsFloat(Int2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3 AsFloat(Int3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4 AsFloat(Int4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x1 AsFloat(Int1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int1x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x2 AsFloat(Int1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int1x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x3 AsFloat(Int1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int1x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x4 AsFloat(Int1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int1x4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x1 AsFloat(Int2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int2x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x2 AsFloat(Int2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int2x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x3 AsFloat(Int2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int2x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x4 AsFloat(Int2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int2x4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x1 AsFloat(Int3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int3x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x2 AsFloat(Int3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int3x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x3 AsFloat(Int3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int3x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x4 AsFloat(Int3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int3x4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x1 AsFloat(Int4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int4x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x2 AsFloat(Int4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int4x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x3 AsFloat(Int4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int4x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x4 AsFloat(Int4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(Int4x4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static float AsFloat(uint x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(uint)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2 AsFloat(UInt2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3 AsFloat(UInt3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4 AsFloat(UInt4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x1 AsFloat(UInt1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt1x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x2 AsFloat(UInt1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt1x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x3 AsFloat(UInt1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt1x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float1x4 AsFloat(UInt1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt1x4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x1 AsFloat(UInt2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt2x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x2 AsFloat(UInt2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt2x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x3 AsFloat(UInt2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt2x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float2x4 AsFloat(UInt2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt2x4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x1 AsFloat(UInt3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt3x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x2 AsFloat(UInt3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt3x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x3 AsFloat(UInt3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt3x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float3x4 AsFloat(UInt3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt3x4)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x1 AsFloat(UInt4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt4x1)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x2 AsFloat(UInt4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt4x2)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x3 AsFloat(UInt4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt4x3)})"); + + /// + /// Interprets the bit pattern of an input value as a floating-point number. + /// + /// The input value. + /// The input interpreted as a floating-point number. + [Pure] + [HlslIntrinsicName("asfloat")] + public static Float4x4 AsFloat(UInt4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsFloat)}({typeof(UInt4x4)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static float Asin(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(float)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2 Asin(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float2)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3 Asin(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float3)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4 Asin(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float4)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x1 Asin(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float1x1)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x2 Asin(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float1x2)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x3 Asin(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float1x3)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float1x4 Asin(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float1x4)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x1 Asin(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float2x1)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x2 Asin(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float2x2)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x3 Asin(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float2x3)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float2x4 Asin(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float2x4)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x1 Asin(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float3x1)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x2 Asin(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float3x2)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x3 Asin(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float3x3)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float3x4 Asin(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float3x4)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x1 Asin(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float4x1)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x2 Asin(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float4x2)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x3 Asin(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float4x3)})"); + + /// + /// Returns the arcsine of the specified value. + /// + /// The specified value. + /// The arcsine of the parameter. + [Pure] + [HlslIntrinsicName("asin")] + public static Float4x4 Asin(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Asin)}({typeof(Float4x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static int AsInt(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(float)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2 AsInt(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3 AsInt(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4 AsInt(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x1 AsInt(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float1x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x2 AsInt(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float1x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x3 AsInt(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float1x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x4 AsInt(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float1x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x1 AsInt(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float2x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x2 AsInt(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float2x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x3 AsInt(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float2x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x4 AsInt(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float2x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x1 AsInt(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float3x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x2 AsInt(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float3x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x3 AsInt(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float3x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x4 AsInt(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float3x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x1 AsInt(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float4x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x2 AsInt(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float4x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x3 AsInt(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float4x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x4 AsInt(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(Float4x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static int AsInt(uint x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(uint)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2 AsInt(UInt2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3 AsInt(UInt3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4 AsInt(UInt4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x1 AsInt(UInt1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt1x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x2 AsInt(UInt1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt1x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x3 AsInt(UInt1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt1x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int1x4 AsInt(UInt1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt1x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x1 AsInt(UInt2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt2x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x2 AsInt(UInt2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt2x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x3 AsInt(UInt2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt2x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int2x4 AsInt(UInt2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt2x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x1 AsInt(UInt3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt3x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x2 AsInt(UInt3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt3x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x3 AsInt(UInt3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt3x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int3x4 AsInt(UInt3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt3x4)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x1 AsInt(UInt4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt4x1)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x2 AsInt(UInt4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt4x2)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x3 AsInt(UInt4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt4x3)})"); + + /// + /// Interprets the bit pattern of an input value as an integer number. + /// + /// The input value. + /// The input interpreted as an integer number. + [Pure] + [HlslIntrinsicName("asint")] + public static Int4x4 AsInt(UInt4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsInt)}({typeof(UInt4x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static uint AsUInt(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(float)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2 AsUInt(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3 AsUInt(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4 AsUInt(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x1 AsUInt(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float1x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x2 AsUInt(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float1x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x3 AsUInt(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float1x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x4 AsUInt(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float1x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x1 AsUInt(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float2x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x2 AsUInt(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float2x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x3 AsUInt(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float2x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x4 AsUInt(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float2x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x1 AsUInt(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float3x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x2 AsUInt(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float3x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x3 AsUInt(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float3x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x4 AsUInt(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float3x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x1 AsUInt(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float4x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x2 AsUInt(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float4x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x3 AsUInt(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float4x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x4 AsUInt(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Float4x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static uint AsUInt(int x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(int)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2 AsUInt(Int2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3 AsUInt(Int3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4 AsUInt(Int4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x1 AsUInt(Int1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int1x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x2 AsUInt(Int1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int1x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x3 AsUInt(Int1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int1x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt1x4 AsUInt(Int1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int1x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x1 AsUInt(Int2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int2x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x2 AsUInt(Int2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int2x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x3 AsUInt(Int2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int2x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt2x4 AsUInt(Int2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int2x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x1 AsUInt(Int3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int3x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x2 AsUInt(Int3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int3x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x3 AsUInt(Int3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int3x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt3x4 AsUInt(Int3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int3x4)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x1 AsUInt(Int4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int4x1)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x2 AsUInt(Int4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int4x2)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x3 AsUInt(Int4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int4x3)})"); + + /// + /// Interprets the bit pattern of an input value as an unsigned integer number. + /// + /// The input value. + /// The input interpreted as an unsigned integer number. + [Pure] + [HlslIntrinsicName("asuint")] + public static UInt4x4 AsUInt(Int4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AsUInt)}({typeof(Int4x4)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static float Atan(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(float)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2 Atan(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float2)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3 Atan(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float3)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4 Atan(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float4)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x1 Atan(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float1x1)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x2 Atan(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float1x2)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x3 Atan(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float1x3)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float1x4 Atan(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float1x4)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x1 Atan(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float2x1)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x2 Atan(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float2x2)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x3 Atan(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float2x3)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float2x4 Atan(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float2x4)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x1 Atan(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float3x1)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x2 Atan(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float3x2)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x3 Atan(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float3x3)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float3x4 Atan(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float3x4)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x1 Atan(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float4x1)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x2 Atan(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float4x2)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x3 Atan(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float4x3)})"); + + /// + /// Returns the arctangent of the specified value. + /// + /// The specified value. + /// The arctangent of the parameter. This value is within the range [-π/2, π/2]. + [Pure] + [HlslIntrinsicName("atan")] + public static Float4x4 Atan(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan)}({typeof(Float4x4)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static float Atan2(float y, float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(float)}, {typeof(float)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2 Atan2(Float2 y, Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3 Atan2(Float3 y, Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4 Atan2(Float4 y, Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x1 Atan2(Float1x1 y, Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x2 Atan2(Float1x2 y, Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x3 Atan2(Float1x3 y, Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float1x4 Atan2(Float1x4 y, Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x1 Atan2(Float2x1 y, Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x2 Atan2(Float2x2 y, Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x3 Atan2(Float2x3 y, Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float2x4 Atan2(Float2x4 y, Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x1 Atan2(Float3x1 y, Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x2 Atan2(Float3x2 y, Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x3 Atan2(Float3x3 y, Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float3x4 Atan2(Float3x4 y, Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x1 Atan2(Float4x1 y, Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x2 Atan2(Float4x2 y, Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x3 Atan2(Float4x3 y, Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the arctangent of two values (y, x). + /// + /// The y value. + /// The x value. + /// The arctangent of (, ). + [Pure] + [HlslIntrinsicName("atan2")] + public static Float4x4 Atan2(Float4x4 y, Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Atan2)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static float Ceil(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(float)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2 Ceil(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float2)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3 Ceil(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float3)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4 Ceil(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float4)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x1 Ceil(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float1x1)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x2 Ceil(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float1x2)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x3 Ceil(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float1x3)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float1x4 Ceil(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float1x4)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x1 Ceil(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float2x1)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x2 Ceil(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float2x2)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x3 Ceil(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float2x3)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float2x4 Ceil(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float2x4)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x1 Ceil(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float3x1)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x2 Ceil(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float3x2)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x3 Ceil(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float3x3)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float3x4 Ceil(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float3x4)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x1 Ceil(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float4x1)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x2 Ceil(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float4x2)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x3 Ceil(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float4x3)})"); + + /// + /// Returns the smallest integer value that is greater than or equal to the specified value. + /// + /// The specified value. + /// The smallest integer value (returned as a floating-point type) that is greater than or equal to the parameter. + [Pure] + [HlslIntrinsicName("ceil")] + public static Float4x4 Ceil(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ceil)}({typeof(Float4x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static float Clamp(float x, float min, float max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(float)}, {typeof(float)}, {typeof(float)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2 Clamp(Float2 x, Float2 min, Float2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float2)}, {typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3 Clamp(Float3 x, Float3 min, Float3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float3)}, {typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4 Clamp(Float4 x, Float4 min, Float4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float4)}, {typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x1 Clamp(Float1x1 x, Float1x1 min, Float1x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float1x1)}, {typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x2 Clamp(Float1x2 x, Float1x2 min, Float1x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float1x2)}, {typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x3 Clamp(Float1x3 x, Float1x3 min, Float1x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float1x3)}, {typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float1x4 Clamp(Float1x4 x, Float1x4 min, Float1x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float1x4)}, {typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x1 Clamp(Float2x1 x, Float2x1 min, Float2x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float2x1)}, {typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x2 Clamp(Float2x2 x, Float2x2 min, Float2x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float2x2)}, {typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x3 Clamp(Float2x3 x, Float2x3 min, Float2x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float2x3)}, {typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float2x4 Clamp(Float2x4 x, Float2x4 min, Float2x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float2x4)}, {typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x1 Clamp(Float3x1 x, Float3x1 min, Float3x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float3x1)}, {typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x2 Clamp(Float3x2 x, Float3x2 min, Float3x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float3x2)}, {typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x3 Clamp(Float3x3 x, Float3x3 min, Float3x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float3x3)}, {typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float3x4 Clamp(Float3x4 x, Float3x4 min, Float3x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float3x4)}, {typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x1 Clamp(Float4x1 x, Float4x1 min, Float4x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float4x1)}, {typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x2 Clamp(Float4x2 x, Float4x2 min, Float4x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float4x2)}, {typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x3 Clamp(Float4x3 x, Float4x3 min, Float4x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float4x3)}, {typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Float4x4 Clamp(Float4x4 x, Float4x4 min, Float4x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Float4x4)}, {typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static int Clamp(int x, int min, int max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(int)}, {typeof(int)}, {typeof(int)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2 Clamp(Int2 x, Int2 min, Int2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int2)}, {typeof(Int2)}, {typeof(Int2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3 Clamp(Int3 x, Int3 min, Int3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int3)}, {typeof(Int3)}, {typeof(Int3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4 Clamp(Int4 x, Int4 min, Int4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int4)}, {typeof(Int4)}, {typeof(Int4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x1 Clamp(Int1x1 x, Int1x1 min, Int1x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int1x1)}, {typeof(Int1x1)}, {typeof(Int1x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x2 Clamp(Int1x2 x, Int1x2 min, Int1x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int1x2)}, {typeof(Int1x2)}, {typeof(Int1x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x3 Clamp(Int1x3 x, Int1x3 min, Int1x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int1x3)}, {typeof(Int1x3)}, {typeof(Int1x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int1x4 Clamp(Int1x4 x, Int1x4 min, Int1x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int1x4)}, {typeof(Int1x4)}, {typeof(Int1x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x1 Clamp(Int2x1 x, Int2x1 min, Int2x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int2x1)}, {typeof(Int2x1)}, {typeof(Int2x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x2 Clamp(Int2x2 x, Int2x2 min, Int2x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int2x2)}, {typeof(Int2x2)}, {typeof(Int2x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x3 Clamp(Int2x3 x, Int2x3 min, Int2x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int2x3)}, {typeof(Int2x3)}, {typeof(Int2x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int2x4 Clamp(Int2x4 x, Int2x4 min, Int2x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int2x4)}, {typeof(Int2x4)}, {typeof(Int2x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x1 Clamp(Int3x1 x, Int3x1 min, Int3x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int3x1)}, {typeof(Int3x1)}, {typeof(Int3x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x2 Clamp(Int3x2 x, Int3x2 min, Int3x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int3x2)}, {typeof(Int3x2)}, {typeof(Int3x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x3 Clamp(Int3x3 x, Int3x3 min, Int3x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int3x3)}, {typeof(Int3x3)}, {typeof(Int3x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int3x4 Clamp(Int3x4 x, Int3x4 min, Int3x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int3x4)}, {typeof(Int3x4)}, {typeof(Int3x4)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x1 Clamp(Int4x1 x, Int4x1 min, Int4x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int4x1)}, {typeof(Int4x1)}, {typeof(Int4x1)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x2 Clamp(Int4x2 x, Int4x2 min, Int4x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int4x2)}, {typeof(Int4x2)}, {typeof(Int4x2)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x3 Clamp(Int4x3 x, Int4x3 min, Int4x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int4x3)}, {typeof(Int4x3)}, {typeof(Int4x3)})"); + + /// + /// Clamps the specified value to the specified minimum and maximum range. + /// + /// The value to clamp. + /// The specified minimum range. + /// The specified maximum range. + /// The clamped value for the parameter. + [Pure] + [HlslIntrinsicName("clamp")] + public static Int4x4 Clamp(Int4x4 x, Int4x4 min, Int4x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Clamp)}({typeof(Int4x4)}, {typeof(Int4x4)}, {typeof(Int4x4)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static float Cos(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(float)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2 Cos(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float2)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3 Cos(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float3)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4 Cos(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float4)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x1 Cos(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float1x1)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x2 Cos(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float1x2)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x3 Cos(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float1x3)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float1x4 Cos(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float1x4)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x1 Cos(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float2x1)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x2 Cos(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float2x2)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x3 Cos(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float2x3)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float2x4 Cos(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float2x4)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x1 Cos(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float3x1)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x2 Cos(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float3x2)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x3 Cos(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float3x3)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float3x4 Cos(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float3x4)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x1 Cos(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float4x1)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x2 Cos(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float4x2)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x3 Cos(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float4x3)})"); + + /// + /// Returns the cosine of the specified value. + /// + /// The specified value, in radians. + /// The cosine of the parameter. + [Pure] + [HlslIntrinsicName("cos")] + public static Float4x4 Cos(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cos)}({typeof(Float4x4)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static float Cosh(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(float)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2 Cosh(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float2)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3 Cosh(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float3)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4 Cosh(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float4)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x1 Cosh(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float1x1)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x2 Cosh(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float1x2)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x3 Cosh(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float1x3)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float1x4 Cosh(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float1x4)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x1 Cosh(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float2x1)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x2 Cosh(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float2x2)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x3 Cosh(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float2x3)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float2x4 Cosh(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float2x4)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x1 Cosh(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float3x1)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x2 Cosh(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float3x2)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x3 Cosh(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float3x3)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float3x4 Cosh(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float3x4)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x1 Cosh(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float4x1)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x2 Cosh(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float4x2)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x3 Cosh(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float4x3)})"); + + /// + /// Returns the hyperbolic cosine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic cosine of the parameter. + [Pure] + [HlslIntrinsicName("cosh")] + public static Float4x4 Cosh(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cosh)}({typeof(Float4x4)})"); + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + [Pure] + [HlslIntrinsicName("countbits")] + public static uint CountBits(uint x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(CountBits)}({typeof(uint)})"); + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + [Pure] + [HlslIntrinsicName("countbits")] + public static UInt2 CountBits(UInt2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(CountBits)}({typeof(UInt2)})"); + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + [Pure] + [HlslIntrinsicName("countbits")] + public static UInt3 CountBits(UInt3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(CountBits)}({typeof(UInt3)})"); + + /// + /// Counts the number of bits (per component) in the input integer. + /// + /// The input value. + /// The number of bits. + [Pure] + [HlslIntrinsicName("countbits")] + public static UInt4 CountBits(UInt4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(CountBits)}({typeof(UInt4)})"); + + /// + /// Returns the cross product of two floating-point, 3D vectors. + /// + /// The first floating-point, 3D vector. + /// The second floating-point, 3D vector. + /// The number of bits. + [Pure] + [HlslIntrinsicName("cross")] + public static Float3 Cross(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Cross)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static float Degrees(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(float)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2 Degrees(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float2)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3 Degrees(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float3)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4 Degrees(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float4)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x1 Degrees(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float1x1)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x2 Degrees(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float1x2)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x3 Degrees(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float1x3)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float1x4 Degrees(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float1x4)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x1 Degrees(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float2x1)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x2 Degrees(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float2x2)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x3 Degrees(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float2x3)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float2x4 Degrees(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float2x4)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x1 Degrees(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float3x1)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x2 Degrees(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float3x2)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x3 Degrees(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float3x3)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float3x4 Degrees(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float3x4)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x1 Degrees(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float4x1)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x2 Degrees(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float4x2)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x3 Degrees(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float4x3)})"); + + /// + /// Converts the specified value from radians to degrees. + /// + /// The specified value. + /// The result of converting the parameter from radians to degrees. + [Pure] + [HlslIntrinsicName("degrees")] + public static Float4x4 Degrees(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Degrees)}({typeof(Float4x4)})"); + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float1x1 m) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Determinant)}({typeof(Float1x1)})"); + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float2x2 m) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Determinant)}({typeof(Float2x2)})"); + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float3x3 m) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Determinant)}({typeof(Float3x3)})"); + + /// + /// Returns the determinant of the specified floating-point, square matrix. + /// + /// The specified value. + /// The floating-point, scalar value that represents the determinant of the parameter. + [Pure] + [HlslIntrinsicName("determinant")] + public static float Determinant(Float4x4 m) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Determinant)}({typeof(Float4x4)})"); + + /// + /// Returns a distance scalar between two vectors. + /// + /// The first floating-point vector to compare. + /// The second floating-point vector to compare. + /// A floating-point, scalar value that represents the distance between the parameter and the parameter. + [Pure] + [HlslIntrinsicName("distance")] + public static Float2 Distance(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Distance)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns a distance scalar between two vectors. + /// + /// The first floating-point vector to compare. + /// The second floating-point vector to compare. + /// A floating-point, scalar value that represents the distance between the parameter and the parameter. + [Pure] + [HlslIntrinsicName("distance")] + public static Float3 Distance(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Distance)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns a distance scalar between two vectors. + /// + /// The first floating-point vector to compare. + /// The second floating-point vector to compare. + /// A floating-point, scalar value that represents the distance between the parameter and the parameter. + [Pure] + [HlslIntrinsicName("distance")] + public static Float4 Distance(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Distance)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Dot)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Dot)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Dot)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Int2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Dot)}({typeof(Int2)}, {typeof(Int2)})"); + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Int3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Dot)}({typeof(Int3)}, {typeof(Int3)})"); + + /// + /// Returns the dot product of two vectors. + /// + /// The first vector. + /// The second vector. + /// The dot product of the parameter and the parameter. + [Pure] + [HlslIntrinsicName("dot")] + public static float Dot(Int4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Dot)}({typeof(Int4)}, {typeof(Int4)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static float Exp(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(float)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2 Exp(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float2)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3 Exp(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float3)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4 Exp(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float4)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x1 Exp(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float1x1)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x2 Exp(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float1x2)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x3 Exp(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float1x3)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float1x4 Exp(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float1x4)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x1 Exp(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float2x1)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x2 Exp(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float2x2)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x3 Exp(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float2x3)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float2x4 Exp(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float2x4)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x1 Exp(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float3x1)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x2 Exp(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float3x2)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x3 Exp(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float3x3)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float3x4 Exp(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float3x4)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x1 Exp(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float4x1)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x2 Exp(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float4x2)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x3 Exp(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float4x3)})"); + + /// + /// Returns the base-e exponential of the specified value. + /// + /// The specified value. + /// The base-e exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp")] + public static Float4x4 Exp(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp)}({typeof(Float4x4)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static float Exp2(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(float)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2 Exp2(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float2)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3 Exp2(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float3)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4 Exp2(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float4)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x1 Exp2(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float1x1)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x2 Exp2(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float1x2)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x3 Exp2(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float1x3)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float1x4 Exp2(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float1x4)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x1 Exp2(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float2x1)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x2 Exp2(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float2x2)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x3 Exp2(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float2x3)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float2x4 Exp2(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float2x4)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x1 Exp2(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float3x1)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x2 Exp2(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float3x2)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x3 Exp2(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float3x3)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float3x4 Exp2(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float3x4)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x1 Exp2(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float4x1)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x2 Exp2(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float4x2)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x3 Exp2(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float4x3)})"); + + /// + /// Returns the base-2 exponential of the specified value. + /// + /// The specified value. + /// The base-2 exponential of the parameter. + [Pure] + [HlslIntrinsicName("exp2")] + public static Float4x4 Exp2(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Exp2)}({typeof(Float4x4)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static int FirstBitHigh(int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(int)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static Int2 FirstBitHigh(Int2 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(Int2)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static Int3 FirstBitHigh(Int3 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(Int3)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static Int4 FirstBitHigh(Int4 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(Int4)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static uint FirstBitHigh(uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(uint)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static UInt2 FirstBitHigh(UInt2 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(UInt2)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static UInt3 FirstBitHigh(UInt3 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(UInt3)})"); + + /// + /// Gets the location of the first set bit starting from the highest order bit and working downward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbithigh")] + public static UInt4 FirstBitHigh(UInt4 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitHigh)}({typeof(UInt4)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static int FirstBitLow(int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(int)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static Int2 FirstBitLow(Int2 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(Int2)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static Int3 FirstBitLow(Int3 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(Int3)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static Int4 FirstBitLow(Int4 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(Int4)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static uint FirstBitLow(uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(uint)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static UInt2 FirstBitLow(UInt2 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(UInt2)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static UInt3 FirstBitLow(UInt3 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(UInt3)})"); + + /// + /// Returns the location of the first set bit starting from the lowest order bit and working upward, per component. + /// + /// The input value. + /// The location of the first set bit. + [Pure] + [HlslIntrinsicName("firstbitlow")] + public static UInt4 FirstBitLow(UInt4 value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FirstBitLow)}({typeof(UInt4)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static float Floor(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(float)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2 Floor(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float2)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3 Floor(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float3)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4 Floor(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float4)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x1 Floor(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float1x1)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x2 Floor(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float1x2)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x3 Floor(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float1x3)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float1x4 Floor(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float1x4)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x1 Floor(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float2x1)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x2 Floor(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float2x2)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x3 Floor(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float2x3)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float2x4 Floor(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float2x4)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x1 Floor(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float3x1)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x2 Floor(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float3x2)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x3 Floor(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float3x3)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float3x4 Floor(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float3x4)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x1 Floor(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float4x1)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x2 Floor(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float4x2)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x3 Floor(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float4x3)})"); + + /// + /// Returns the largest integer that is less than or equal to the specified value. + /// + /// The specified value. + /// The largest integer value (returned as a floating-point type) that is less than or equal to the parameter. + [Pure] + [HlslIntrinsicName("floor")] + public static Float4x4 Floor(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Floor)}({typeof(Float4x4)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static double FusedMultiplyAccumulate(double a, double b, double c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(double)}, {typeof(double)}, {typeof(double)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double2 FusedMultiplyAccumulate(Double2 a, Double2 b, Double2 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double2)}, {typeof(Double2)}, {typeof(Double2)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double3 FusedMultiplyAccumulate(Double3 a, Double3 b, Double3 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double3)}, {typeof(Double3)}, {typeof(Double3)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double4 FusedMultiplyAccumulate(Double4 a, Double4 b, Double4 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double4)}, {typeof(Double4)}, {typeof(Double4)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x1 FusedMultiplyAccumulate(Double1x1 a, Double1x1 b, Double1x1 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double1x1)}, {typeof(Double1x1)}, {typeof(Double1x1)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x2 FusedMultiplyAccumulate(Double1x2 a, Double1x2 b, Double1x2 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double1x2)}, {typeof(Double1x2)}, {typeof(Double1x2)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x3 FusedMultiplyAccumulate(Double1x3 a, Double1x3 b, Double1x3 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double1x3)}, {typeof(Double1x3)}, {typeof(Double1x3)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double1x4 FusedMultiplyAccumulate(Double1x4 a, Double1x4 b, Double1x4 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double1x4)}, {typeof(Double1x4)}, {typeof(Double1x4)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x1 FusedMultiplyAccumulate(Double2x1 a, Double2x1 b, Double2x1 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double2x1)}, {typeof(Double2x1)}, {typeof(Double2x1)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x2 FusedMultiplyAccumulate(Double2x2 a, Double2x2 b, Double2x2 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double2x2)}, {typeof(Double2x2)}, {typeof(Double2x2)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x3 FusedMultiplyAccumulate(Double2x3 a, Double2x3 b, Double2x3 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double2x3)}, {typeof(Double2x3)}, {typeof(Double2x3)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double2x4 FusedMultiplyAccumulate(Double2x4 a, Double2x4 b, Double2x4 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double2x4)}, {typeof(Double2x4)}, {typeof(Double2x4)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x1 FusedMultiplyAccumulate(Double3x1 a, Double3x1 b, Double3x1 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double3x1)}, {typeof(Double3x1)}, {typeof(Double3x1)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x2 FusedMultiplyAccumulate(Double3x2 a, Double3x2 b, Double3x2 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double3x2)}, {typeof(Double3x2)}, {typeof(Double3x2)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x3 FusedMultiplyAccumulate(Double3x3 a, Double3x3 b, Double3x3 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double3x3)}, {typeof(Double3x3)}, {typeof(Double3x3)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double3x4 FusedMultiplyAccumulate(Double3x4 a, Double3x4 b, Double3x4 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double3x4)}, {typeof(Double3x4)}, {typeof(Double3x4)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x1 FusedMultiplyAccumulate(Double4x1 a, Double4x1 b, Double4x1 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double4x1)}, {typeof(Double4x1)}, {typeof(Double4x1)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x2 FusedMultiplyAccumulate(Double4x2 a, Double4x2 b, Double4x2 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double4x2)}, {typeof(Double4x2)}, {typeof(Double4x2)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x3 FusedMultiplyAccumulate(Double4x3 a, Double4x3 b, Double4x3 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double4x3)}, {typeof(Double4x3)}, {typeof(Double4x3)})"); + + /// + /// Returns the double-precision fused multiply-addition of a * b + c. + /// + /// The first value in the fused multiply-addition. + /// The second value in the fused multiply-addition. + /// The third value in the fused multiply-addition. + /// The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP). + [Pure] + [HlslIntrinsicName("fma")] + public static Double4x4 FusedMultiplyAccumulate(Double4x4 a, Double4x4 b, Double4x4 c) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(FusedMultiplyAccumulate)}({typeof(Double4x4)}, {typeof(Double4x4)}, {typeof(Double4x4)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static float Fmod(float x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(float)}, {typeof(float)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2 Fmod(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3 Fmod(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4 Fmod(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x1 Fmod(Float1x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x2 Fmod(Float1x2 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x3 Fmod(Float1x3 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float1x4 Fmod(Float1x4 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x1 Fmod(Float2x1 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x2 Fmod(Float2x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x3 Fmod(Float2x3 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float2x4 Fmod(Float2x4 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x1 Fmod(Float3x1 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x2 Fmod(Float3x2 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x3 Fmod(Float3x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float3x4 Fmod(Float3x4 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x1 Fmod(Float4x1 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x2 Fmod(Float4x2 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x3 Fmod(Float4x3 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the floating-point remainder of x / y. + /// + /// The floating-point dividend. + /// The floating-point divisor. + /// The floating-point remainder of the x parameter divided by the y parameter. + [Pure] + [HlslIntrinsicName("fmod")] + public static Float4x4 Fmod(Float4x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Fmod)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static float Frac(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(float)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2 Frac(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float2)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3 Frac(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float3)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4 Frac(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float4)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x1 Frac(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float1x1)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x2 Frac(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float1x2)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x3 Frac(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float1x3)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float1x4 Frac(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float1x4)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x1 Frac(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float2x1)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x2 Frac(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float2x2)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x3 Frac(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float2x3)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float2x4 Frac(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float2x4)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x1 Frac(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float3x1)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x2 Frac(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float3x2)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x3 Frac(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float3x3)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float3x4 Frac(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float3x4)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x1 Frac(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float4x1)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x2 Frac(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float4x2)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x3 Frac(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float4x3)})"); + + /// + /// Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1. + /// + /// The specified value. + /// The fractional part of the parameter. + [Pure] + [HlslIntrinsicName("frac")] + public static Float4x4 Frac(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frac)}({typeof(Float4x4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static float Frexp(float x, out float exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(float)}, {typeof(float)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float2 Frexp(Float2 x, out Float2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float3 Frexp(Float3 x, out Float3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float4 Frexp(Float4 x, out Float4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float1x1 Frexp(Float1x1 x, out Float1x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float1x2 Frexp(Float1x2 x, out Float1x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float1x3 Frexp(Float1x3 x, out Float1x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float1x4 Frexp(Float1x4 x, out Float1x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float2x1 Frexp(Float2x1 x, out Float2x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float2x2 Frexp(Float2x2 x, out Float2x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float2x3 Frexp(Float2x3 x, out Float2x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float2x4 Frexp(Float2x4 x, out Float2x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float3x1 Frexp(Float3x1 x, out Float3x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float3x2 Frexp(Float3x2 x, out Float3x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float3x3 Frexp(Float3x3 x, out Float3x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float3x4 Frexp(Float3x4 x, out Float3x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float4x1 Frexp(Float4x1 x, out Float4x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float4x2 Frexp(Float4x2 x, out Float4x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float4x3 Frexp(Float4x3 x, out Float4x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the mantissa and exponent of the specified floating-point value. + /// + /// The specified floating-point value. + /// The returned exponent of the input parameter. + /// The mantissa of the parameter. + [HlslIntrinsicName("frexp")] + public static Float4x4 Frexp(Float4x4 x, out Float4x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Frexp)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static bool IsFinite(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(float)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2 IsFinite(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float2)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3 IsFinite(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float3)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4 IsFinite(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float4)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x1 IsFinite(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float1x1)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x2 IsFinite(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float1x2)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x3 IsFinite(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float1x3)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool1x4 IsFinite(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float1x4)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x1 IsFinite(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float2x1)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x2 IsFinite(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float2x2)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x3 IsFinite(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float2x3)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool2x4 IsFinite(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float2x4)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x1 IsFinite(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float3x1)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x2 IsFinite(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float3x2)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x3 IsFinite(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float3x3)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool3x4 IsFinite(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float3x4)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x1 IsFinite(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float4x1)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x2 IsFinite(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float4x2)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x3 IsFinite(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float4x3)})"); + + /// + /// Determines if the specified floating-point value is finite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is finite. + [Pure] + [HlslIntrinsicName("isfinite")] + public static Bool4x4 IsFinite(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsFinite)}({typeof(Float4x4)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static bool IsInfinite(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(float)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2 IsInfinite(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float2)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3 IsInfinite(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float3)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4 IsInfinite(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float4)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x1 IsInfinite(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float1x1)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x2 IsInfinite(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float1x2)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x3 IsInfinite(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float1x3)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool1x4 IsInfinite(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float1x4)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x1 IsInfinite(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float2x1)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x2 IsInfinite(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float2x2)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x3 IsInfinite(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float2x3)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool2x4 IsInfinite(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float2x4)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x1 IsInfinite(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float3x1)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x2 IsInfinite(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float3x2)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x3 IsInfinite(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float3x3)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool3x4 IsInfinite(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float3x4)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x1 IsInfinite(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float4x1)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x2 IsInfinite(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float4x2)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x3 IsInfinite(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float4x3)})"); + + /// + /// Determines if the specified value is infinite. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is infinite. + [Pure] + [HlslIntrinsicName("isinf")] + public static Bool4x4 IsInfinite(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsInfinite)}({typeof(Float4x4)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static bool IsNaN(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(float)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2 IsNaN(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float2)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3 IsNaN(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float3)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4 IsNaN(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float4)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x1 IsNaN(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float1x1)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x2 IsNaN(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float1x2)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x3 IsNaN(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float1x3)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool1x4 IsNaN(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float1x4)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x1 IsNaN(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float2x1)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x2 IsNaN(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float2x2)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x3 IsNaN(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float2x3)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool2x4 IsNaN(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float2x4)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x1 IsNaN(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float3x1)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x2 IsNaN(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float3x2)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x3 IsNaN(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float3x3)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool3x4 IsNaN(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float3x4)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x1 IsNaN(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float4x1)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x2 IsNaN(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float4x2)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x3 IsNaN(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float4x3)})"); + + /// + /// Determines if the specified value is NAN or QNAN. + /// + /// The specified value. + /// Returns a value of the same size as , indicaating whether each component is NAN or QNAN. + [Pure] + [HlslIntrinsicName("isnan")] + public static Bool4x4 IsNaN(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(IsNaN)}({typeof(Float4x4)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static float Ldexp(float x, float exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(float)}, {typeof(float)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2 Ldexp(Float2 x, Float2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3 Ldexp(Float3 x, Float3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4 Ldexp(Float4 x, Float4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x1 Ldexp(Float1x1 x, Float1x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x2 Ldexp(Float1x2 x, Float1x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x3 Ldexp(Float1x3 x, Float1x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float1x4 Ldexp(Float1x4 x, Float1x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x1 Ldexp(Float2x1 x, Float2x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x2 Ldexp(Float2x2 x, Float2x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x3 Ldexp(Float2x3 x, Float2x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float2x4 Ldexp(Float2x4 x, Float2x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x1 Ldexp(Float3x1 x, Float3x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x2 Ldexp(Float3x2 x, Float3x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x3 Ldexp(Float3x3 x, Float3x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float3x4 Ldexp(Float3x4 x, Float3x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x1 Ldexp(Float4x1 x, Float4x1 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x2 Ldexp(Float4x2 x, Float4x2 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x3 Ldexp(Float4x3 x, Float4x3 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the result of multiplying the specified value by two, raised to the power of the specified exponent. + /// + /// The specified value. + /// The specified exponent. + /// The result of multiplying the parameter by two, raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("ldexp")] + public static Float4x4 Ldexp(Float4x4 x, Float4x4 exp) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Ldexp)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the parameter. + [Pure] + [HlslIntrinsicName("length")] + public static float Length(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Length)}({typeof(Float2)})"); + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the parameter. + [Pure] + [HlslIntrinsicName("length")] + public static float Length(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Length)}({typeof(Float3)})"); + + /// + /// Returns the length of the specified floating-point vector. + /// + /// The specified floating-point vector. + /// A floating-point scalar that represents the length of the parameter. + [Pure] + [HlslIntrinsicName("length")] + public static float Length(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Length)}({typeof(Float4)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static float Lerp(float x, float min, float max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(float)}, {typeof(float)}, {typeof(float)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2 Lerp(Float2 x, Float2 min, Float2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float2)}, {typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3 Lerp(Float3 x, Float3 min, Float3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float3)}, {typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4 Lerp(Float4 x, Float4 min, Float4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float4)}, {typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x1 Lerp(Float1x1 x, Float1x1 min, Float1x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float1x1)}, {typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x2 Lerp(Float1x2 x, Float1x2 min, Float1x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float1x2)}, {typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x3 Lerp(Float1x3 x, Float1x3 min, Float1x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float1x3)}, {typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float1x4 Lerp(Float1x4 x, Float1x4 min, Float1x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float1x4)}, {typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x1 Lerp(Float2x1 x, Float2x1 min, Float2x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float2x1)}, {typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x2 Lerp(Float2x2 x, Float2x2 min, Float2x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float2x2)}, {typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x3 Lerp(Float2x3 x, Float2x3 min, Float2x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float2x3)}, {typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float2x4 Lerp(Float2x4 x, Float2x4 min, Float2x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float2x4)}, {typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x1 Lerp(Float3x1 x, Float3x1 min, Float3x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float3x1)}, {typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x2 Lerp(Float3x2 x, Float3x2 min, Float3x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float3x2)}, {typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x3 Lerp(Float3x3 x, Float3x3 min, Float3x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float3x3)}, {typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float3x4 Lerp(Float3x4 x, Float3x4 min, Float3x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float3x4)}, {typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x1 Lerp(Float4x1 x, Float4x1 min, Float4x1 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float4x1)}, {typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x2 Lerp(Float4x2 x, Float4x2 min, Float4x2 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float4x2)}, {typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x3 Lerp(Float4x3 x, Float4x3 min, Float4x3 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float4x3)}, {typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Performs a linear interpolation. + /// + /// The first-floating point value. + /// The second-floating point value. + /// A value that linearly interpolates between the two inputs. + /// The result of the linear interpolation. + [Pure] + [HlslIntrinsicName("lerp")] + public static Float4x4 Lerp(Float4x4 x, Float4x4 min, Float4x4 max) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Lerp)}({typeof(Float4x4)}, {typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static float Log(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(float)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float2 Log(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float2)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float3 Log(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float3)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float4 Log(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float4)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x1 Log(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float1x1)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x2 Log(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float1x2)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x3 Log(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float1x3)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float1x4 Log(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float1x4)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x1 Log(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float2x1)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x2 Log(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float2x2)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x3 Log(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float2x3)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float2x4 Log(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float2x4)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x1 Log(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float3x1)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x2 Log(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float3x2)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x3 Log(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float3x3)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float3x4 Log(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float3x4)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x1 Log(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float4x1)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x2 Log(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float4x2)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x3 Log(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float4x3)})"); + + /// + /// Returns the base-e logarithm of the specified value. + /// + /// The specified value. + /// The base-e logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log")] + public static Float4x4 Log(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log)}({typeof(Float4x4)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static float Log10(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(float)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2 Log10(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float2)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3 Log10(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float3)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4 Log10(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float4)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x1 Log10(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float1x1)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x2 Log10(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float1x2)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x3 Log10(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float1x3)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float1x4 Log10(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float1x4)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x1 Log10(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float2x1)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x2 Log10(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float2x2)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x3 Log10(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float2x3)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float2x4 Log10(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float2x4)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x1 Log10(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float3x1)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x2 Log10(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float3x2)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x3 Log10(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float3x3)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float3x4 Log10(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float3x4)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x1 Log10(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float4x1)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x2 Log10(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float4x2)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x3 Log10(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float4x3)})"); + + /// + /// Returns the base-10 logarithm of the specified value. + /// + /// The specified value. + /// The base-10 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log10")] + public static Float4x4 Log10(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log10)}({typeof(Float4x4)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static float Log2(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(float)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2 Log2(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float2)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3 Log2(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float3)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4 Log2(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float4)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x1 Log2(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float1x1)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x2 Log2(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float1x2)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x3 Log2(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float1x3)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float1x4 Log2(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float1x4)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x1 Log2(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float2x1)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x2 Log2(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float2x2)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x3 Log2(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float2x3)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float2x4 Log2(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float2x4)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x1 Log2(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float3x1)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x2 Log2(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float3x2)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x3 Log2(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float3x3)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float3x4 Log2(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float3x4)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x1 Log2(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float4x1)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x2 Log2(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float4x2)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x3 Log2(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float4x3)})"); + + /// + /// Returns the base-2 logarithm of the specified value. + /// + /// The specified value. + /// The base-2 logarithm of the parameter. If the parameter is negative, this function returns indefinite. If the parameter is 0, this function returns negative infinity. + [Pure] + [HlslIntrinsicName("log2")] + public static Float4x4 Log2(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Log2)}({typeof(Float4x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static float Max(float x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(float)}, {typeof(float)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float2 Max(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float3 Max(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float4 Max(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x1 Max(Float1x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x2 Max(Float1x2 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x3 Max(Float1x3 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float1x4 Max(Float1x4 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x1 Max(Float2x1 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x2 Max(Float2x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x3 Max(Float2x3 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float2x4 Max(Float2x4 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x1 Max(Float3x1 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x2 Max(Float3x2 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x3 Max(Float3x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float3x4 Max(Float3x4 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x1 Max(Float4x1 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x2 Max(Float4x2 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x3 Max(Float4x3 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Float4x4 Max(Float4x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static int Max(int x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(int)}, {typeof(int)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int2 Max(Int2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int2)}, {typeof(Int2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int3 Max(Int3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int3)}, {typeof(Int3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int4 Max(Int4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int4)}, {typeof(Int4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x1 Max(Int1x1 x, Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int1x1)}, {typeof(Int1x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x2 Max(Int1x2 x, Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int1x2)}, {typeof(Int1x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x3 Max(Int1x3 x, Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int1x3)}, {typeof(Int1x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int1x4 Max(Int1x4 x, Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int1x4)}, {typeof(Int1x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x1 Max(Int2x1 x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int2x1)}, {typeof(Int2x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x2 Max(Int2x2 x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int2x2)}, {typeof(Int2x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x3 Max(Int2x3 x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int2x3)}, {typeof(Int2x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int2x4 Max(Int2x4 x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int2x4)}, {typeof(Int2x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x1 Max(Int3x1 x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int3x1)}, {typeof(Int3x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x2 Max(Int3x2 x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int3x2)}, {typeof(Int3x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x3 Max(Int3x3 x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int3x3)}, {typeof(Int3x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int3x4 Max(Int3x4 x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int3x4)}, {typeof(Int3x4)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x1 Max(Int4x1 x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int4x1)}, {typeof(Int4x1)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x2 Max(Int4x2 x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int4x2)}, {typeof(Int4x2)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x3 Max(Int4x3 x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int4x3)}, {typeof(Int4x3)})"); + + /// + /// Selects the greater between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the largest value. + [Pure] + [HlslIntrinsicName("max")] + public static Int4x4 Max(Int4x4 x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Max)}({typeof(Int4x4)}, {typeof(Int4x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static float Min(float x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(float)}, {typeof(float)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float2 Min(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float3 Min(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float4 Min(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x1 Min(Float1x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x2 Min(Float1x2 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x3 Min(Float1x3 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float1x4 Min(Float1x4 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x1 Min(Float2x1 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x2 Min(Float2x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x3 Min(Float2x3 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float2x4 Min(Float2x4 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x1 Min(Float3x1 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x2 Min(Float3x2 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x3 Min(Float3x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float3x4 Min(Float3x4 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x1 Min(Float4x1 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x2 Min(Float4x2 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x3 Min(Float4x3 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Float4x4 Min(Float4x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static int Min(int x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(int)}, {typeof(int)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int2 Min(Int2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int2)}, {typeof(Int2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int3 Min(Int3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int3)}, {typeof(Int3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int4 Min(Int4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int4)}, {typeof(Int4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x1 Min(Int1x1 x, Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int1x1)}, {typeof(Int1x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x2 Min(Int1x2 x, Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int1x2)}, {typeof(Int1x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x3 Min(Int1x3 x, Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int1x3)}, {typeof(Int1x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int1x4 Min(Int1x4 x, Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int1x4)}, {typeof(Int1x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x1 Min(Int2x1 x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int2x1)}, {typeof(Int2x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x2 Min(Int2x2 x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int2x2)}, {typeof(Int2x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x3 Min(Int2x3 x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int2x3)}, {typeof(Int2x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int2x4 Min(Int2x4 x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int2x4)}, {typeof(Int2x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x1 Min(Int3x1 x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int3x1)}, {typeof(Int3x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x2 Min(Int3x2 x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int3x2)}, {typeof(Int3x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x3 Min(Int3x3 x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int3x3)}, {typeof(Int3x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int3x4 Min(Int3x4 x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int3x4)}, {typeof(Int3x4)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x1 Min(Int4x1 x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int4x1)}, {typeof(Int4x1)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x2 Min(Int4x2 x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int4x2)}, {typeof(Int4x2)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x3 Min(Int4x3 x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int4x3)}, {typeof(Int4x3)})"); + + /// + /// Selects the lesser between two inputs. + /// + /// The first input value. + /// The second input value. + /// The or parameter, whichever is the smallest value. + [Pure] + [HlslIntrinsicName("min")] + public static Int4x4 Min(Int4x4 x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Min)}({typeof(Int4x4)}, {typeof(Int4x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static float Modf(float x, out float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(float)}, {typeof(float)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float2 Modf(Float2 x, out Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float3 Modf(Float3 x, out Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float4 Modf(Float4 x, out Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x1 Modf(Float1x1 x, out Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x2 Modf(Float1x2 x, out Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x3 Modf(Float1x3 x, out Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float1x4 Modf(Float1x4 x, out Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x1 Modf(Float2x1 x, out Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x2 Modf(Float2x2 x, out Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x3 Modf(Float2x3 x, out Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float2x4 Modf(Float2x4 x, out Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x1 Modf(Float3x1 x, out Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x2 Modf(Float3x2 x, out Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x3 Modf(Float3x3 x, out Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float3x4 Modf(Float3x4 x, out Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x1 Modf(Float4x1 x, out Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x2 Modf(Float4x2 x, out Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x3 Modf(Float4x3 x, out Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Float4x4 Modf(Float4x4 x, out Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static int Modf(int x, out int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(int)}, {typeof(int)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int2 Modf(Int2 x, out Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2)}, {typeof(Int2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int3 Modf(Int3 x, out Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3)}, {typeof(Int3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int4 Modf(Int4 x, out Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4)}, {typeof(Int4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x1 Modf(Int1x1 x, out Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x1)}, {typeof(Int1x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x2 Modf(Int1x2 x, out Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x2)}, {typeof(Int1x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x3 Modf(Int1x3 x, out Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x3)}, {typeof(Int1x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int1x4 Modf(Int1x4 x, out Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int1x4)}, {typeof(Int1x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x1 Modf(Int2x1 x, out Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x1)}, {typeof(Int2x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x2 Modf(Int2x2 x, out Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x2)}, {typeof(Int2x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x3 Modf(Int2x3 x, out Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x3)}, {typeof(Int2x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int2x4 Modf(Int2x4 x, out Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int2x4)}, {typeof(Int2x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x1 Modf(Int3x1 x, out Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x1)}, {typeof(Int3x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x2 Modf(Int3x2 x, out Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x2)}, {typeof(Int3x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x3 Modf(Int3x3 x, out Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x3)}, {typeof(Int3x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int3x4 Modf(Int3x4 x, out Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int3x4)}, {typeof(Int3x4)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x1 Modf(Int4x1 x, out Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x1)}, {typeof(Int4x1)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x2 Modf(Int4x2 x, out Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x2)}, {typeof(Int4x2)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x3 Modf(Int4x3 x, out Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x3)}, {typeof(Int4x3)})"); + + /// + /// Splits a value into fractional and integer parts, each with the same sign as the input value. + /// + /// The input value. + /// The resulting integer portion. + /// The signed-fractional portion of . + [Pure] + [HlslIntrinsicName("modf")] + public static Int4x4 Modf(Int4x4 x, out Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Modf)}({typeof(Int4x4)}, {typeof(Int4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(float x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(int x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(float x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(float x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(float x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(int x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(int x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(int x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(float x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(float x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(float x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(float x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(float x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(float x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(float x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(float x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(float x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(float x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(float x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(float x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(float x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(float x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(float x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(float x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(float)}, {typeof(Float4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(int x, Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(int x, Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(int x, Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(int x, Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(int x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(int x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(int x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(int x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(int x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(int x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(int x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(int x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(int x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(int x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(int x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(int x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(int)}, {typeof(Int4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2)}, {typeof(Int2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3)}, {typeof(Int3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4)}, {typeof(Int4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float2 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2)}, {typeof(Float2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2)}, {typeof(Float2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float2 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2)}, {typeof(Float2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float2 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2)}, {typeof(Float2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float3 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3)}, {typeof(Float3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float3 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3)}, {typeof(Float3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3)}, {typeof(Float3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float3 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3)}, {typeof(Float3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float4 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4)}, {typeof(Float4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float4 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4)}, {typeof(Float4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float4 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4)}, {typeof(Float4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4)}, {typeof(Float4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int2 x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2)}, {typeof(Int2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2 x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2)}, {typeof(Int2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int2 x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2)}, {typeof(Int2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int2 x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2)}, {typeof(Int2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int3 x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3)}, {typeof(Int3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int3 x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3)}, {typeof(Int3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3 x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3)}, {typeof(Int3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int3 x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3)}, {typeof(Int3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int4 x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4)}, {typeof(Int4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int4 x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4)}, {typeof(Int4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int4 x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4)}, {typeof(Int4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4 x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4)}, {typeof(Int4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x1 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x1)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x2 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x2)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x3 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x3)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x4 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x4)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x1 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x1)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x2 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x2)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x3 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x3)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x4 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x4)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x1 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x1)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x2 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x2)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x3 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x3)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x4 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x4)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x1 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x1)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x2 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x2)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x3 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x3)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x4 x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x4)}, {typeof(float)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x1 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x1)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x2 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x2)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x3 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x3)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x4 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x4)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x1 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x1)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x2 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x2)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x3 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x3)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x4 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x4)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x1 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x1)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x2 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x2)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x3 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x3)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x4 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x4)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x1 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x1)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x2 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x2)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x3 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x3)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x4 x, int y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x4)}, {typeof(int)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float1x2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x2)}, {typeof(Float2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float1x3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x3)}, {typeof(Float3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static float Mul(Float1x4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x4)}, {typeof(Float4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2x2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x2)}, {typeof(Float2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2x3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x3)}, {typeof(Float3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2 Mul(Float2x4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x4)}, {typeof(Float4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3x2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x2)}, {typeof(Float2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3x3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x3)}, {typeof(Float3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3 Mul(Float3x4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x4)}, {typeof(Float4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4x2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x2)}, {typeof(Float2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4x3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x3)}, {typeof(Float3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4 Mul(Float4x4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x4)}, {typeof(Float4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int1x2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x2)}, {typeof(Int2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int1x3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x3)}, {typeof(Int3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static int Mul(Int1x4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x4)}, {typeof(Int4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2x2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x2)}, {typeof(Int2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2x3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x3)}, {typeof(Int3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2 Mul(Int2x4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x4)}, {typeof(Int4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3x2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x2)}, {typeof(Int2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3x3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x3)}, {typeof(Int3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3 Mul(Int3x4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x4)}, {typeof(Int4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4x2 x, Int2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x2)}, {typeof(Int2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4x3 x, Int3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x3)}, {typeof(Int3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4 Mul(Int4x4 x, Int4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x4)}, {typeof(Int4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x1 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x1)}, {typeof(Float1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x1 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x1)}, {typeof(Float1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x1 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x1)}, {typeof(Float1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x2 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x2)}, {typeof(Float2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x2)}, {typeof(Float2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x2 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x2)}, {typeof(Float2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x2 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x2)}, {typeof(Float2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x3 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x3)}, {typeof(Float3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x3 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x3)}, {typeof(Float3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x3)}, {typeof(Float3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x3 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x3)}, {typeof(Float3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x1 Mul(Float1x4 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x4)}, {typeof(Float4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x2 Mul(Float1x4 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x4)}, {typeof(Float4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x3 Mul(Float1x4 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x4)}, {typeof(Float4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float1x4 Mul(Float1x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float1x4)}, {typeof(Float4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x1)}, {typeof(Float1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x1 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x1)}, {typeof(Float1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x1 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x1)}, {typeof(Float1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x1 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x1)}, {typeof(Float1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x2 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x2)}, {typeof(Float2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x2 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x2)}, {typeof(Float2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x2 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x2)}, {typeof(Float2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x3 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x3)}, {typeof(Float3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x3 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x3)}, {typeof(Float3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x3)}, {typeof(Float3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x3 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x3)}, {typeof(Float3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x1 Mul(Float2x4 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x4)}, {typeof(Float4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x2 Mul(Float2x4 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x4)}, {typeof(Float4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x3 Mul(Float2x4 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x4)}, {typeof(Float4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float2x4 Mul(Float2x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float2x4)}, {typeof(Float4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x1)}, {typeof(Float1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x1 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x1)}, {typeof(Float1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x1 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x1)}, {typeof(Float1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x1 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x1)}, {typeof(Float1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x2 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x2)}, {typeof(Float2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x2)}, {typeof(Float2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x2 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x2)}, {typeof(Float2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x2 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x2)}, {typeof(Float2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x3 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x3)}, {typeof(Float3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x3 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x3)}, {typeof(Float3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x3 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x3)}, {typeof(Float3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x1 Mul(Float3x4 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x4)}, {typeof(Float4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x2 Mul(Float3x4 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x4)}, {typeof(Float4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x3 Mul(Float3x4 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x4)}, {typeof(Float4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float3x4 Mul(Float3x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float3x4)}, {typeof(Float4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x1)}, {typeof(Float1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x1 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x1)}, {typeof(Float1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x1 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x1)}, {typeof(Float1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x1 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x1)}, {typeof(Float1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x2 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x2)}, {typeof(Float2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x2)}, {typeof(Float2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x2 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x2)}, {typeof(Float2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x2 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x2)}, {typeof(Float2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x3 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x3)}, {typeof(Float3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x3 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x3)}, {typeof(Float3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x3)}, {typeof(Float3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x3 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x3)}, {typeof(Float3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x1 Mul(Float4x4 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x4)}, {typeof(Float4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x2 Mul(Float4x4 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x4)}, {typeof(Float4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x3 Mul(Float4x4 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x4)}, {typeof(Float4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Float4x4 Mul(Float4x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x1 x, Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x1)}, {typeof(Int1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x1 x, Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x1)}, {typeof(Int1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x1 x, Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x1)}, {typeof(Int1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x1 x, Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x1)}, {typeof(Int1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x2 x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x2)}, {typeof(Int2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x2 x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x2)}, {typeof(Int2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x2 x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x2)}, {typeof(Int2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x2 x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x2)}, {typeof(Int2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x3 x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x3)}, {typeof(Int3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x3 x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x3)}, {typeof(Int3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x3 x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x3)}, {typeof(Int3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x3 x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x3)}, {typeof(Int3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x1 Mul(Int1x4 x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x4)}, {typeof(Int4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x2 Mul(Int1x4 x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x4)}, {typeof(Int4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x3 Mul(Int1x4 x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x4)}, {typeof(Int4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int1x4 Mul(Int1x4 x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int1x4)}, {typeof(Int4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x1 x, Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x1)}, {typeof(Int1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x1 x, Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x1)}, {typeof(Int1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x1 x, Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x1)}, {typeof(Int1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x1 x, Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x1)}, {typeof(Int1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x2 x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x2)}, {typeof(Int2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x2 x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x2)}, {typeof(Int2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x2 x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x2)}, {typeof(Int2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x2 x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x2)}, {typeof(Int2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x3 x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x3)}, {typeof(Int3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x3 x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x3)}, {typeof(Int3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x3 x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x3)}, {typeof(Int3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x3 x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x3)}, {typeof(Int3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x1 Mul(Int2x4 x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x4)}, {typeof(Int4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x2 Mul(Int2x4 x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x4)}, {typeof(Int4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x3 Mul(Int2x4 x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x4)}, {typeof(Int4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int2x4 Mul(Int2x4 x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int2x4)}, {typeof(Int4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x1 x, Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x1)}, {typeof(Int1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x1 x, Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x1)}, {typeof(Int1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x1 x, Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x1)}, {typeof(Int1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x1 x, Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x1)}, {typeof(Int1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x2 x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x2)}, {typeof(Int2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x2 x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x2)}, {typeof(Int2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x2 x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x2)}, {typeof(Int2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x2 x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x2)}, {typeof(Int2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x3 x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x3)}, {typeof(Int3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x3 x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x3)}, {typeof(Int3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x3 x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x3)}, {typeof(Int3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x3 x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x3)}, {typeof(Int3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x1 Mul(Int3x4 x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x4)}, {typeof(Int4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x2 Mul(Int3x4 x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x4)}, {typeof(Int4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x3 Mul(Int3x4 x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x4)}, {typeof(Int4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int3x4 Mul(Int3x4 x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int3x4)}, {typeof(Int4x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x1 x, Int1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x1)}, {typeof(Int1x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x1 x, Int1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x1)}, {typeof(Int1x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x1 x, Int1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x1)}, {typeof(Int1x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x1 x, Int1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x1)}, {typeof(Int1x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x2 x, Int2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x2)}, {typeof(Int2x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x2 x, Int2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x2)}, {typeof(Int2x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x2 x, Int2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x2)}, {typeof(Int2x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x2 x, Int2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x2)}, {typeof(Int2x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x3 x, Int3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x3)}, {typeof(Int3x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x3 x, Int3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x3)}, {typeof(Int3x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x3 x, Int3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x3)}, {typeof(Int3x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x3 x, Int3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x3)}, {typeof(Int3x4)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x1 Mul(Int4x4 x, Int4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x4)}, {typeof(Int4x1)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x2 Mul(Int4x4 x, Int4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x4)}, {typeof(Int4x2)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x3 Mul(Int4x4 x, Int4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x4)}, {typeof(Int4x3)})"); + + /// + /// Multiplies two values using matrix math. + /// + /// The first input value. + /// The second input value. + /// The result of times . The result has the dimension -rows by -columns. + [Pure] + [HlslIntrinsicName("mul")] + public static Int4x4 Mul(Int4x4 x, Int4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Mul)}({typeof(Int4x4)}, {typeof(Int4x4)})"); + + /// + /// Generates a random value using the Perlin-noise algorithm. + /// + /// A floating-point vector from which to generate Perlin noise. + /// The Perlin noise value within a range between -1 and 1. + [Pure] + [HlslIntrinsicName("noise")] + public static float Noise(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Noise)}({typeof(Float2)})"); + + /// + /// Generates a random value using the Perlin-noise algorithm. + /// + /// A floating-point vector from which to generate Perlin noise. + /// The Perlin noise value within a range between -1 and 1. + [Pure] + [HlslIntrinsicName("noise")] + public static float Noise(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Noise)}({typeof(Float3)})"); + + /// + /// Generates a random value using the Perlin-noise algorithm. + /// + /// A floating-point vector from which to generate Perlin noise. + /// The Perlin noise value within a range between -1 and 1. + [Pure] + [HlslIntrinsicName("noise")] + public static float Noise(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Noise)}({typeof(Float4)})"); + + /// + /// Normalizes the specified floating-point vector according to x / length(x). + /// + /// The specified floating-point vector. + /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. + [Pure] + [HlslIntrinsicName("normalize")] + public static float Normalize(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Normalize)}({typeof(Float2)})"); + + /// + /// Normalizes the specified floating-point vector according to x / length(x). + /// + /// The specified floating-point vector. + /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. + [Pure] + [HlslIntrinsicName("normalize")] + public static float Normalize(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Normalize)}({typeof(Float3)})"); + + /// + /// Normalizes the specified floating-point vector according to x / length(x). + /// + /// The specified floating-point vector. + /// The normalized parameter. If the length of the parameter is 0, the result is indefinite. + [Pure] + [HlslIntrinsicName("normalize")] + public static float Normalize(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Normalize)}({typeof(Float4)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static float Pow(float x, float y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(float)}, {typeof(float)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2 Pow(Float2 x, Float2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3 Pow(Float3 x, Float3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4 Pow(Float4 x, Float4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x1 Pow(Float1x1 x, Float1x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x2 Pow(Float1x2 x, Float1x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x3 Pow(Float1x3 x, Float1x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float1x4 Pow(Float1x4 x, Float1x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x1 Pow(Float2x1 x, Float2x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x2 Pow(Float2x2 x, Float2x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x3 Pow(Float2x3 x, Float2x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float2x4 Pow(Float2x4 x, Float2x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x1 Pow(Float3x1 x, Float3x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x2 Pow(Float3x2 x, Float3x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x3 Pow(Float3x3 x, Float3x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float3x4 Pow(Float3x4 x, Float3x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x1 Pow(Float4x1 x, Float4x1 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x2 Pow(Float4x2 x, Float4x2 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x3 Pow(Float4x3 x, Float4x3 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the specified value raised to the specified power. + /// + /// The specified value. + /// The specified power. + /// The parameter raised to the power of the parameter. + [Pure] + [HlslIntrinsicName("pow")] + public static Float4x4 Pow(Float4x4 x, Float4x4 y) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Pow)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static float Radians(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(float)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2 Radians(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float2)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3 Radians(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float3)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4 Radians(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float4)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x1 Radians(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float1x1)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x2 Radians(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float1x2)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x3 Radians(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float1x3)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float1x4 Radians(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float1x4)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x1 Radians(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float2x1)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x2 Radians(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float2x2)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x3 Radians(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float2x3)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float2x4 Radians(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float2x4)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x1 Radians(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float3x1)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x2 Radians(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float3x2)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x3 Radians(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float3x3)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float3x4 Radians(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float3x4)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x1 Radians(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float4x1)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x2 Radians(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float4x2)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x3 Radians(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float4x3)})"); + + /// + /// Converts the specified value from degrees to radians. + /// + /// The specified value. + /// The parameter converted from degrees to radians. + [Pure] + [HlslIntrinsicName("radians")] + public static Float4x4 Radians(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Radians)}({typeof(Float4x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static float Rcp(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(float)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2 Rcp(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3 Rcp(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4 Rcp(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x1 Rcp(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float1x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x2 Rcp(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float1x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x3 Rcp(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float1x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float1x4 Rcp(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float1x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x1 Rcp(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float2x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x2 Rcp(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float2x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x3 Rcp(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float2x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float2x4 Rcp(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float2x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x1 Rcp(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float3x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x2 Rcp(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float3x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x3 Rcp(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float3x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float3x4 Rcp(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float3x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x1 Rcp(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float4x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x2 Rcp(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float4x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x3 Rcp(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float4x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Float4x4 Rcp(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Float4x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static double Rcp(double x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(double)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2 Rcp(Double2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3 Rcp(Double3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4 Rcp(Double4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x1 Rcp(Double1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double1x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x2 Rcp(Double1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double1x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x3 Rcp(Double1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double1x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double1x4 Rcp(Double1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double1x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x1 Rcp(Double2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double2x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x2 Rcp(Double2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double2x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x3 Rcp(Double2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double2x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double2x4 Rcp(Double2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double2x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x1 Rcp(Double3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double3x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x2 Rcp(Double3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double3x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x3 Rcp(Double3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double3x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double3x4 Rcp(Double3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double3x4)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x1 Rcp(Double4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double4x1)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x2 Rcp(Double4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double4x2)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x3 Rcp(Double4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double4x3)})"); + + /// + /// Calculates a fast, approximate, per-component reciprocal. + /// + /// The input value. + /// The reciprocal of the parameter. + [Pure] + [HlslIntrinsicName("rcp")] + public static Double4x4 Rcp(Double4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rcp)}({typeof(Double4x4)})"); + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + [Pure] + [HlslIntrinsicName("reversebits")] + public static uint ReverseBits(uint x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(ReverseBits)}({typeof(uint)})"); + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + [Pure] + [HlslIntrinsicName("reversebits")] + public static UInt2 ReverseBits(UInt2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(ReverseBits)}({typeof(UInt2)})"); + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + [Pure] + [HlslIntrinsicName("reversebits")] + public static UInt3 ReverseBits(UInt3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(ReverseBits)}({typeof(UInt3)})"); + + /// + /// Reverses the order of the bits, per component. + /// + /// The input value. + /// The input value, with the bit order reversed. + [Pure] + [HlslIntrinsicName("reversebits")] + public static UInt4 ReverseBits(UInt4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(ReverseBits)}({typeof(UInt4)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static float Round(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(float)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float2 Round(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float2)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float3 Round(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float3)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float4 Round(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float4)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x1 Round(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float1x1)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x2 Round(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float1x2)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x3 Round(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float1x3)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float1x4 Round(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float1x4)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x1 Round(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float2x1)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x2 Round(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float2x2)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x3 Round(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float2x3)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float2x4 Round(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float2x4)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x1 Round(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float3x1)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x2 Round(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float3x2)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x3 Round(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float3x3)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float3x4 Round(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float3x4)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x1 Round(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float4x1)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x2 Round(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float4x2)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x3 Round(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float4x3)})"); + + /// + /// Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even. + /// + /// The specified value. + /// The parameter, rounded to the nearest integer within a floating-point type. + [Pure] + [HlslIntrinsicName("round")] + public static Float4x4 Round(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Round)}({typeof(Float4x4)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static float Rsqrt(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(float)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2 Rsqrt(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float2)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3 Rsqrt(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float3)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4 Rsqrt(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float4)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x1 Rsqrt(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float1x1)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x2 Rsqrt(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float1x2)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x3 Rsqrt(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float1x3)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float1x4 Rsqrt(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float1x4)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x1 Rsqrt(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float2x1)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x2 Rsqrt(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float2x2)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x3 Rsqrt(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float2x3)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float2x4 Rsqrt(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float2x4)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x1 Rsqrt(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float3x1)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x2 Rsqrt(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float3x2)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x3 Rsqrt(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float3x3)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float3x4 Rsqrt(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float3x4)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x1 Rsqrt(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float4x1)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x2 Rsqrt(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float4x2)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x3 Rsqrt(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float4x3)})"); + + /// + /// Returns the reciprocal of the square root of the specified value. + /// + /// The specified value. + /// The reciprocal of the square root of the parameter. + [Pure] + [HlslIntrinsicName("rsqrt")] + public static Float4x4 Rsqrt(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Rsqrt)}({typeof(Float4x4)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static float Saturate(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(float)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2 Saturate(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float2)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3 Saturate(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float3)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4 Saturate(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float4)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x1 Saturate(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float1x1)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x2 Saturate(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float1x2)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x3 Saturate(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float1x3)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float1x4 Saturate(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float1x4)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x1 Saturate(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float2x1)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x2 Saturate(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float2x2)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x3 Saturate(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float2x3)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float2x4 Saturate(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float2x4)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x1 Saturate(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float3x1)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x2 Saturate(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float3x2)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x3 Saturate(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float3x3)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float3x4 Saturate(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float3x4)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x1 Saturate(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float4x1)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x2 Saturate(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float4x2)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x3 Saturate(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float4x3)})"); + + /// + /// Clamps the specified value within the range of 0 to 1. + /// + /// The specified value. + /// The parameter, clamped within the range of 0 to 1. + [Pure] + [HlslIntrinsicName("saturate")] + public static Float4x4 Saturate(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Saturate)}({typeof(Float4x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static int Sign(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(float)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2 Sign(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3 Sign(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4 Sign(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x1 Sign(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float1x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x2 Sign(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float1x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x3 Sign(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float1x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x4 Sign(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float1x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x1 Sign(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float2x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x2 Sign(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float2x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x3 Sign(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float2x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x4 Sign(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float2x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x1 Sign(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float3x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x2 Sign(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float3x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x3 Sign(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float3x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x4 Sign(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float3x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x1 Sign(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float4x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x2 Sign(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float4x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x3 Sign(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float4x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x4 Sign(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Float4x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static int Sign(int x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(int)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2 Sign(Int2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3 Sign(Int3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4 Sign(Int4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x1 Sign(Int1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int1x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x2 Sign(Int1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int1x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x3 Sign(Int1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int1x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int1x4 Sign(Int1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int1x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x1 Sign(Int2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int2x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x2 Sign(Int2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int2x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x3 Sign(Int2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int2x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int2x4 Sign(Int2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int2x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x1 Sign(Int3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int3x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x2 Sign(Int3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int3x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x3 Sign(Int3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int3x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int3x4 Sign(Int3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int3x4)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x1 Sign(Int4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int4x1)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x2 Sign(Int4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int4x2)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x3 Sign(Int4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int4x3)})"); + + /// + /// Returns the sign of the input value. + /// + /// The specified value. + /// Returns -1 if is less than zero; 0 if equals zero; and 1 if is greater than zero. + [Pure] + [HlslIntrinsicName("sign")] + public static Int4x4 Sign(Int4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sign)}({typeof(Int4x4)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static float Sin(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(float)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2 Sin(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float2)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3 Sin(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float3)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4 Sin(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float4)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x1 Sin(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float1x1)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x2 Sin(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float1x2)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x3 Sin(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float1x3)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float1x4 Sin(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float1x4)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x1 Sin(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float2x1)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x2 Sin(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float2x2)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x3 Sin(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float2x3)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float2x4 Sin(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float2x4)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x1 Sin(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float3x1)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x2 Sin(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float3x2)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x3 Sin(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float3x3)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float3x4 Sin(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float3x4)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x1 Sin(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float4x1)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x2 Sin(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float4x2)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x3 Sin(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float4x3)})"); + + /// + /// Returns the sine of the specified value. + /// + /// The specified value, in radians. + /// The sine of the parameter. + [Pure] + [HlslIntrinsicName("sin")] + public static Float4x4 Sin(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sin)}({typeof(Float4x4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(float x, out float sin, out float cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(float)}, {typeof(float)}, {typeof(float)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2 x, out Float2 sin, out Float2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2)}, {typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3 x, out Float3 sin, out Float3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3)}, {typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4 x, out Float4 sin, out Float4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4)}, {typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x1 x, out Float1x1 sin, out Float1x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x1)}, {typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x2 x, out Float1x2 sin, out Float1x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x2)}, {typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x3 x, out Float1x3 sin, out Float1x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x3)}, {typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float1x4 x, out Float1x4 sin, out Float1x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float1x4)}, {typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x1 x, out Float2x1 sin, out Float2x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x1)}, {typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x2 x, out Float2x2 sin, out Float2x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x2)}, {typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x3 x, out Float2x3 sin, out Float2x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x3)}, {typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float2x4 x, out Float2x4 sin, out Float2x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float2x4)}, {typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x1 x, out Float3x1 sin, out Float3x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x1)}, {typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x2 x, out Float3x2 sin, out Float3x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x2)}, {typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x3 x, out Float3x3 sin, out Float3x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x3)}, {typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float3x4 x, out Float3x4 sin, out Float3x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float3x4)}, {typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x1 x, out Float4x1 sin, out Float4x1 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x1)}, {typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x2 x, out Float4x2 sin, out Float4x2 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x2)}, {typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x3 x, out Float4x3 sin, out Float4x3 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x3)}, {typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns the sine and cosine of a specified value. + /// + /// The specified value, in radians. + /// The resulting sine. + /// The resulting cosine. + [Pure] + [HlslIntrinsicName("sincos")] + public static void SinCos(Float4x4 x, out Float4x4 sin, out Float4x4 cos) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SinCos)}({typeof(Float4x4)}, {typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static float Sinh(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(float)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2 Sinh(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float2)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3 Sinh(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float3)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4 Sinh(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float4)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x1 Sinh(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float1x1)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x2 Sinh(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float1x2)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x3 Sinh(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float1x3)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float1x4 Sinh(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float1x4)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x1 Sinh(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float2x1)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x2 Sinh(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float2x2)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x3 Sinh(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float2x3)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float2x4 Sinh(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float2x4)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x1 Sinh(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float3x1)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x2 Sinh(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float3x2)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x3 Sinh(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float3x3)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float3x4 Sinh(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float3x4)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x1 Sinh(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float4x1)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x2 Sinh(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float4x2)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x3 Sinh(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float4x3)})"); + + /// + /// Returns the hyperbolic sine of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic sine of the parameter. + [Pure] + [HlslIntrinsicName("sinh")] + public static Float4x4 Sinh(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sinh)}({typeof(Float4x4)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static float SmoothStep(float min, float max, float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(float)}, {typeof(float)}, {typeof(float)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2 SmoothStep(Float2 min, Float2 max, Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float2)}, {typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3 SmoothStep(Float3 min, Float3 max, Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float3)}, {typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4 SmoothStep(Float4 min, Float4 max, Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float4)}, {typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x1 SmoothStep(Float1x1 min, Float1x1 max, Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float1x1)}, {typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x2 SmoothStep(Float1x2 min, Float1x2 max, Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float1x2)}, {typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x3 SmoothStep(Float1x3 min, Float1x3 max, Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float1x3)}, {typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float1x4 SmoothStep(Float1x4 min, Float1x4 max, Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float1x4)}, {typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x1 SmoothStep(Float2x1 min, Float2x1 max, Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float2x1)}, {typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x2 SmoothStep(Float2x2 min, Float2x2 max, Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float2x2)}, {typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x3 SmoothStep(Float2x3 min, Float2x3 max, Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float2x3)}, {typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float2x4 SmoothStep(Float2x4 min, Float2x4 max, Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float2x4)}, {typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x1 SmoothStep(Float3x1 min, Float3x1 max, Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float3x1)}, {typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x2 SmoothStep(Float3x2 min, Float3x2 max, Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float3x2)}, {typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x3 SmoothStep(Float3x3 min, Float3x3 max, Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float3x3)}, {typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float3x4 SmoothStep(Float3x4 min, Float3x4 max, Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float3x4)}, {typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x1 SmoothStep(Float4x1 min, Float4x1 max, Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float4x1)}, {typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x2 SmoothStep(Float4x2 min, Float4x2 max, Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float4x2)}, {typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x3 SmoothStep(Float4x3 min, Float4x3 max, Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float4x3)}, {typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range. + /// + /// The specified minimum range. + /// The specified maximum range. + /// The specified value to be interpolated. + /// Returns 0 if is less than ; 1 if is greater than ; otherwise, a value between 0 and 1 if is in the range [, ]. + [Pure] + [HlslIntrinsicName("smoothstep")] + public static Float4x4 SmoothStep(Float4x4 min, Float4x4 max, Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(SmoothStep)}({typeof(Float4x4)}, {typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static float Sqrt(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(float)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2 Sqrt(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float2)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3 Sqrt(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float3)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4 Sqrt(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float4)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x1 Sqrt(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float1x1)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x2 Sqrt(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float1x2)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x3 Sqrt(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float1x3)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float1x4 Sqrt(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float1x4)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x1 Sqrt(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float2x1)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x2 Sqrt(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float2x2)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x3 Sqrt(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float2x3)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float2x4 Sqrt(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float2x4)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x1 Sqrt(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float3x1)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x2 Sqrt(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float3x2)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x3 Sqrt(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float3x3)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float3x4 Sqrt(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float3x4)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x1 Sqrt(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float4x1)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x2 Sqrt(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float4x2)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x3 Sqrt(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float4x3)})"); + + /// + /// Returns the square root of the specified floating-point value, per component. + /// + /// The specified floating-point value. + /// The square root of the parameter, per component. + [Pure] + [HlslIntrinsicName("sqrt")] + public static Float4x4 Sqrt(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Sqrt)}({typeof(Float4x4)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static float Step(float y, float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(float)}, {typeof(float)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float2 Step(Float2 y, Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float2)}, {typeof(Float2)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float3 Step(Float3 y, Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float3)}, {typeof(Float3)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float4 Step(Float4 y, Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float4)}, {typeof(Float4)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x1 Step(Float1x1 y, Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float1x1)}, {typeof(Float1x1)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x2 Step(Float1x2 y, Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float1x2)}, {typeof(Float1x2)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x3 Step(Float1x3 y, Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float1x3)}, {typeof(Float1x3)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float1x4 Step(Float1x4 y, Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float1x4)}, {typeof(Float1x4)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x1 Step(Float2x1 y, Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float2x1)}, {typeof(Float2x1)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x2 Step(Float2x2 y, Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float2x2)}, {typeof(Float2x2)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x3 Step(Float2x3 y, Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float2x3)}, {typeof(Float2x3)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float2x4 Step(Float2x4 y, Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float2x4)}, {typeof(Float2x4)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x1 Step(Float3x1 y, Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float3x1)}, {typeof(Float3x1)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x2 Step(Float3x2 y, Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float3x2)}, {typeof(Float3x2)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x3 Step(Float3x3 y, Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float3x3)}, {typeof(Float3x3)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float3x4 Step(Float3x4 y, Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float3x4)}, {typeof(Float3x4)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x1 Step(Float4x1 y, Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float4x1)}, {typeof(Float4x1)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x2 Step(Float4x2 y, Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float4x2)}, {typeof(Float4x2)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x3 Step(Float4x3 y, Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float4x3)}, {typeof(Float4x3)})"); + + /// + /// Compares two values, returning 0 or 1 based on which value is greater. + /// + /// The first specified floating-point value. + /// The second specified floating-point value. + /// 1 if the parameter is greater than or equal to the parameter; otherwise, 0. + [Pure] + [HlslIntrinsicName("step")] + public static Float4x4 Step(Float4x4 y, Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Step)}({typeof(Float4x4)}, {typeof(Float4x4)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static float Tan(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(float)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2 Tan(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float2)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3 Tan(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float3)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4 Tan(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float4)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x1 Tan(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float1x1)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x2 Tan(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float1x2)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x3 Tan(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float1x3)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float1x4 Tan(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float1x4)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x1 Tan(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float2x1)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x2 Tan(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float2x2)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x3 Tan(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float2x3)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float2x4 Tan(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float2x4)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x1 Tan(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float3x1)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x2 Tan(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float3x2)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x3 Tan(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float3x3)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float3x4 Tan(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float3x4)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x1 Tan(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float4x1)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x2 Tan(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float4x2)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x3 Tan(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float4x3)})"); + + /// + /// Returns the tangent of the specified value. + /// + /// The specified value, in radians. + /// The tangent of the parameter. + [Pure] + [HlslIntrinsicName("tan")] + public static Float4x4 Tan(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tan)}({typeof(Float4x4)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static float Tanh(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(float)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2 Tanh(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float2)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3 Tanh(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float3)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4 Tanh(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float4)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x1 Tanh(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float1x1)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x2 Tanh(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float1x2)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x3 Tanh(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float1x3)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float1x4 Tanh(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float1x4)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x1 Tanh(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float2x1)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x2 Tanh(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float2x2)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x3 Tanh(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float2x3)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float2x4 Tanh(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float2x4)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x1 Tanh(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float3x1)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x2 Tanh(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float3x2)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x3 Tanh(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float3x3)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float3x4 Tanh(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float3x4)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x1 Tanh(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float4x1)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x2 Tanh(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float4x2)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x3 Tanh(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float4x3)})"); + + /// + /// Returns the hyperbolic tangent of the specified value. + /// + /// The specified value, in radians. + /// The hyperbolic tangent of the parameter. + [Pure] + [HlslIntrinsicName("tanh")] + public static Float4x4 Tanh(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Tanh)}({typeof(Float4x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float2x1 Transpose(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float1x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float3x1 Transpose(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float1x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float4x1 Transpose(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float1x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float1x2 Transpose(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float2x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float3x2 Transpose(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float2x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float4x2 Transpose(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float2x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float1x3 Transpose(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float3x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float2x3 Transpose(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float3x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float4x3 Transpose(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float3x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float1x4 Transpose(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float4x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float2x4 Transpose(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float4x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Float3x4 Transpose(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Float4x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int2x1 Transpose(Int1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int1x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int3x1 Transpose(Int1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int1x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int4x1 Transpose(Int1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int1x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int1x2 Transpose(Int2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int2x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int3x2 Transpose(Int2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int2x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int4x2 Transpose(Int2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int2x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int1x3 Transpose(Int3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int3x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int2x3 Transpose(Int3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int3x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int4x3 Transpose(Int3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int3x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int1x4 Transpose(Int4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int4x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int2x4 Transpose(Int4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int4x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Int3x4 Transpose(Int4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Int4x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool2x1 Transpose(Bool1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool1x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool3x1 Transpose(Bool1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool1x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool4x1 Transpose(Bool1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool1x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool1x2 Transpose(Bool2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool2x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool3x2 Transpose(Bool2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool2x3)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool4x2 Transpose(Bool2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool2x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool1x3 Transpose(Bool3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool3x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool2x3 Transpose(Bool3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool3x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool4x3 Transpose(Bool3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool3x4)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool1x4 Transpose(Bool4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool4x1)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool2x4 Transpose(Bool4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool4x2)})"); + + /// + /// Transposes the specified input matrix. + /// + /// The specified matrix. + /// The transposed value of the parameter. + [Pure] + [HlslIntrinsicName("transpose")] + public static Bool3x4 Transpose(Bool4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Transpose)}({typeof(Bool4x3)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static float Trunc(float x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(float)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2 Trunc(Float2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float2)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3 Trunc(Float3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float3)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4 Trunc(Float4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float4)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x1 Trunc(Float1x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float1x1)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x2 Trunc(Float1x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float1x2)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x3 Trunc(Float1x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float1x3)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float1x4 Trunc(Float1x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float1x4)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x1 Trunc(Float2x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float2x1)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x2 Trunc(Float2x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float2x2)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x3 Trunc(Float2x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float2x3)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float2x4 Trunc(Float2x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float2x4)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x1 Trunc(Float3x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float3x1)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x2 Trunc(Float3x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float3x2)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x3 Trunc(Float3x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float3x3)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float3x4 Trunc(Float3x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float3x4)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x1 Trunc(Float4x1 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float4x1)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x2 Trunc(Float4x2 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float4x2)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x3 Trunc(Float4x3 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float4x3)})"); + + /// + /// Truncates a floating-point value to the integer component. + /// + /// The specified input. + /// The input value truncated to an integer component. + [Pure] + [HlslIntrinsicName("trunc")] + public static Float4x4 Trunc(Float4x4 x) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(Trunc)}({typeof(Float4x4)})"); + } +} diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.tt b/src/ComputeSharp/Core/Intrinsics/Hlsl.tt new file mode 100644 index 00000000..f8d4292f --- /dev/null +++ b/src/ComputeSharp/Core/Intrinsics/Hlsl.tt @@ -0,0 +1,57 @@ +<#@include file="Hlsl.ttinclude" #> +using System.Diagnostics.Contracts; +using ComputeSharp.Core.Intrinsics.Attributes; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + public static partial class Hlsl + { +<# +PushIndent(" "); +PushIndent(" "); + +bool isFirst = true; + +foreach (var intrinsic in Intrinsics) +{ + foreach (var overload in intrinsic.Overloads) + { + if (isFirst) isFirst = false; + else WriteLine(""); + + WriteLine("/// "); + WriteLine($"/// {intrinsic.Summary}"); + WriteLine("/// "); + + foreach (var param in intrinsic.Parameters) + { + WriteLine($"/// {param.Info}"); + } + + if (intrinsic.Returns.Length > 0) + { + var returns = Regex.Replace(intrinsic.Returns, @"{(\w+)}", m => $""); + + WriteLine($"/// {returns}"); + } + + if (intrinsic.IsPure) WriteLine("[Pure]"); + WriteLine($"[HlslIntrinsicName(\"{intrinsic.HlslName}\")]"); + + Write($"public static {overload.Return} {intrinsic.Name}("); + Write(string.Join(", ", intrinsic.Parameters.Zip(overload.Params, (a, b) => $"{(a.IsOut ? "out " : "")}{b} {a.Name}"))); + Write(") => throw new InvalidExecutionContextException("); + + var parameters = string.Join(", ", overload.Params.Select(t => $"{{typeof({t})}}")); + + WriteLine($"$\"{{typeof(Hlsl)}}.{{nameof({intrinsic.Name})}}({parameters})\");"); + } +} + +PopIndent(); +PopIndent(); +#> + } +} diff --git a/src/ComputeSharp/Core/Intrinsics/Hlsl.ttinclude b/src/ComputeSharp/Core/Intrinsics/Hlsl.ttinclude new file mode 100644 index 00000000..18195278 --- /dev/null +++ b/src/ComputeSharp/Core/Intrinsics/Hlsl.ttinclude @@ -0,0 +1,2603 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Text.RegularExpressions" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".g.cs"#> +<# +var Intrinsics = new[] +{ + new + { + Name = "Abs", + HlslName = "abs", + Summary = "Returns the absolute value of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The absolute value of the {x} parameter.", + Overloads = new[] + { + new { Return = "int", Params = new[] { "int" } }, + new { Return = "Int2", Params = new[] { "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4" } }, + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Acos", + HlslName = "acos", + Summary = "Returns the arccosine of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value. Each component should be a floating-point within the range [-1, 1]." } + }, + Returns = "The arccosine of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "All", + HlslName = "all", + Summary = "Determines if all components of the specified value are non-zero.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "Whether or not all components of the {x} parameter are non-zero.", + Overloads = new[] + { + new { Return = "bool", Params = new[] { "int" } }, + new { Return = "bool", Params = new[] { "Int2" } }, + new { Return = "bool", Params = new[] { "Int3" } }, + new { Return = "bool", Params = new[] { "Int4" } }, + new { Return = "bool", Params = new[] { "Int1x1" } }, + new { Return = "bool", Params = new[] { "Int1x2" } }, + new { Return = "bool", Params = new[] { "Int1x3" } }, + new { Return = "bool", Params = new[] { "Int1x4" } }, + new { Return = "bool", Params = new[] { "Int2x1" } }, + new { Return = "bool", Params = new[] { "Int2x2" } }, + new { Return = "bool", Params = new[] { "Int2x3" } }, + new { Return = "bool", Params = new[] { "Int2x4" } }, + new { Return = "bool", Params = new[] { "Int3x1" } }, + new { Return = "bool", Params = new[] { "Int3x2" } }, + new { Return = "bool", Params = new[] { "Int3x3" } }, + new { Return = "bool", Params = new[] { "Int3x4" } }, + new { Return = "bool", Params = new[] { "Int4x1" } }, + new { Return = "bool", Params = new[] { "Int4x2" } }, + new { Return = "bool", Params = new[] { "Int4x3" } }, + new { Return = "bool", Params = new[] { "Int4x4" } }, + new { Return = "bool", Params = new[] { "float" } }, + new { Return = "bool", Params = new[] { "Float2" } }, + new { Return = "bool", Params = new[] { "Float3" } }, + new { Return = "bool", Params = new[] { "Float4" } }, + new { Return = "bool", Params = new[] { "Float1x1" } }, + new { Return = "bool", Params = new[] { "Float1x2" } }, + new { Return = "bool", Params = new[] { "Float1x3" } }, + new { Return = "bool", Params = new[] { "Float1x4" } }, + new { Return = "bool", Params = new[] { "Float2x1" } }, + new { Return = "bool", Params = new[] { "Float2x2" } }, + new { Return = "bool", Params = new[] { "Float2x3" } }, + new { Return = "bool", Params = new[] { "Float2x4" } }, + new { Return = "bool", Params = new[] { "Float3x1" } }, + new { Return = "bool", Params = new[] { "Float3x2" } }, + new { Return = "bool", Params = new[] { "Float3x3" } }, + new { Return = "bool", Params = new[] { "Float3x4" } }, + new { Return = "bool", Params = new[] { "Float4x1" } }, + new { Return = "bool", Params = new[] { "Float4x2" } }, + new { Return = "bool", Params = new[] { "Float4x3" } }, + new { Return = "bool", Params = new[] { "Float4x4" } }, + new { Return = "bool", Params = new[] { "bool" } }, + new { Return = "bool", Params = new[] { "Bool2" } }, + new { Return = "bool", Params = new[] { "Bool3" } }, + new { Return = "bool", Params = new[] { "Bool4" } }, + new { Return = "bool", Params = new[] { "Bool1x1" } }, + new { Return = "bool", Params = new[] { "Bool1x2" } }, + new { Return = "bool", Params = new[] { "Bool1x3" } }, + new { Return = "bool", Params = new[] { "Bool1x4" } }, + new { Return = "bool", Params = new[] { "Bool2x1" } }, + new { Return = "bool", Params = new[] { "Bool2x2" } }, + new { Return = "bool", Params = new[] { "Bool2x3" } }, + new { Return = "bool", Params = new[] { "Bool2x4" } }, + new { Return = "bool", Params = new[] { "Bool3x1" } }, + new { Return = "bool", Params = new[] { "Bool3x2" } }, + new { Return = "bool", Params = new[] { "Bool3x3" } }, + new { Return = "bool", Params = new[] { "Bool3x4" } }, + new { Return = "bool", Params = new[] { "Bool4x1" } }, + new { Return = "bool", Params = new[] { "Bool4x2" } }, + new { Return = "bool", Params = new[] { "Bool4x3" } }, + new { Return = "bool", Params = new[] { "Bool4x4" } } + }, + IsPure = true + }, + new + { + Name = "Any", + HlslName = "any", + Summary = "Determines if any components of the specified value are non-zero.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "Whether or not any components of the {x} parameter are non-zero.", + Overloads = new[] + { + new { Return = "bool", Params = new[] { "int" } }, + new { Return = "bool", Params = new[] { "Int2" } }, + new { Return = "bool", Params = new[] { "Int3" } }, + new { Return = "bool", Params = new[] { "Int4" } }, + new { Return = "bool", Params = new[] { "Int1x1" } }, + new { Return = "bool", Params = new[] { "Int1x2" } }, + new { Return = "bool", Params = new[] { "Int1x3" } }, + new { Return = "bool", Params = new[] { "Int1x4" } }, + new { Return = "bool", Params = new[] { "Int2x1" } }, + new { Return = "bool", Params = new[] { "Int2x2" } }, + new { Return = "bool", Params = new[] { "Int2x3" } }, + new { Return = "bool", Params = new[] { "Int2x4" } }, + new { Return = "bool", Params = new[] { "Int3x1" } }, + new { Return = "bool", Params = new[] { "Int3x2" } }, + new { Return = "bool", Params = new[] { "Int3x3" } }, + new { Return = "bool", Params = new[] { "Int3x4" } }, + new { Return = "bool", Params = new[] { "Int4x1" } }, + new { Return = "bool", Params = new[] { "Int4x2" } }, + new { Return = "bool", Params = new[] { "Int4x3" } }, + new { Return = "bool", Params = new[] { "Int4x4" } }, + new { Return = "bool", Params = new[] { "float" } }, + new { Return = "bool", Params = new[] { "Float2" } }, + new { Return = "bool", Params = new[] { "Float3" } }, + new { Return = "bool", Params = new[] { "Float4" } }, + new { Return = "bool", Params = new[] { "Float1x1" } }, + new { Return = "bool", Params = new[] { "Float1x2" } }, + new { Return = "bool", Params = new[] { "Float1x3" } }, + new { Return = "bool", Params = new[] { "Float1x4" } }, + new { Return = "bool", Params = new[] { "Float2x1" } }, + new { Return = "bool", Params = new[] { "Float2x2" } }, + new { Return = "bool", Params = new[] { "Float2x3" } }, + new { Return = "bool", Params = new[] { "Float2x4" } }, + new { Return = "bool", Params = new[] { "Float3x1" } }, + new { Return = "bool", Params = new[] { "Float3x2" } }, + new { Return = "bool", Params = new[] { "Float3x3" } }, + new { Return = "bool", Params = new[] { "Float3x4" } }, + new { Return = "bool", Params = new[] { "Float4x1" } }, + new { Return = "bool", Params = new[] { "Float4x2" } }, + new { Return = "bool", Params = new[] { "Float4x3" } }, + new { Return = "bool", Params = new[] { "Float4x4" } }, + new { Return = "bool", Params = new[] { "bool" } }, + new { Return = "bool", Params = new[] { "Bool2" } }, + new { Return = "bool", Params = new[] { "Bool3" } }, + new { Return = "bool", Params = new[] { "Bool4" } }, + new { Return = "bool", Params = new[] { "Bool1x1" } }, + new { Return = "bool", Params = new[] { "Bool1x2" } }, + new { Return = "bool", Params = new[] { "Bool1x3" } }, + new { Return = "bool", Params = new[] { "Bool1x4" } }, + new { Return = "bool", Params = new[] { "Bool2x1" } }, + new { Return = "bool", Params = new[] { "Bool2x2" } }, + new { Return = "bool", Params = new[] { "Bool2x3" } }, + new { Return = "bool", Params = new[] { "Bool2x4" } }, + new { Return = "bool", Params = new[] { "Bool3x1" } }, + new { Return = "bool", Params = new[] { "Bool3x2" } }, + new { Return = "bool", Params = new[] { "Bool3x3" } }, + new { Return = "bool", Params = new[] { "Bool3x4" } }, + new { Return = "bool", Params = new[] { "Bool4x1" } }, + new { Return = "bool", Params = new[] { "Bool4x2" } }, + new { Return = "bool", Params = new[] { "Bool4x3" } }, + new { Return = "bool", Params = new[] { "Bool4x4" } } + }, + IsPure = true + }, + new + { + Name = "AsDouble", + HlslName = "asdouble", + Summary = "Reinterprets a cast value (two 32-bit values) into a double precision floating-point value.", + Parameters = new[] + { + new { IsOut = false, Name = "lowbits", Info = "The low 32-bit pattern of the input value." }, + new { IsOut = false, Name = "highbits", Info = "The high 32-bit pattern of the input value." } + }, + Returns = "The input (two 32-bit values) recast as a double precision floating-point number.", + Overloads = new[] + { + new { Return = "double", Params = new[] { "uint", "uint" } }, + new { Return = "Double2", Params = new[] { "UInt2", "UInt2" } } + }, + IsPure = true + }, + new + { + Name = "AsFloat", + HlslName = "asfloat", + Summary = "Interprets the bit pattern of an input value as a floating-point number.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The input value." } + }, + Returns = "The input interpreted as a floating-point number.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "int" } }, + new { Return = "Float2", Params = new[] { "Int2" } }, + new { Return = "Float3", Params = new[] { "Int3" } }, + new { Return = "Float4", Params = new[] { "Int4" } }, + new { Return = "Float1x1", Params = new[] { "Int1x1" } }, + new { Return = "Float1x2", Params = new[] { "Int1x2" } }, + new { Return = "Float1x3", Params = new[] { "Int1x3" } }, + new { Return = "Float1x4", Params = new[] { "Int1x4" } }, + new { Return = "Float2x1", Params = new[] { "Int2x1" } }, + new { Return = "Float2x2", Params = new[] { "Int2x2" } }, + new { Return = "Float2x3", Params = new[] { "Int2x3" } }, + new { Return = "Float2x4", Params = new[] { "Int2x4" } }, + new { Return = "Float3x1", Params = new[] { "Int3x1" } }, + new { Return = "Float3x2", Params = new[] { "Int3x2" } }, + new { Return = "Float3x3", Params = new[] { "Int3x3" } }, + new { Return = "Float3x4", Params = new[] { "Int3x4" } }, + new { Return = "Float4x1", Params = new[] { "Int4x1" } }, + new { Return = "Float4x2", Params = new[] { "Int4x2" } }, + new { Return = "Float4x3", Params = new[] { "Int4x3" } }, + new { Return = "Float4x4", Params = new[] { "Int4x4" } }, + new { Return = "float", Params = new[] { "uint" } }, + new { Return = "Float2", Params = new[] { "UInt2" } }, + new { Return = "Float3", Params = new[] { "UInt3" } }, + new { Return = "Float4", Params = new[] { "UInt4" } }, + new { Return = "Float1x1", Params = new[] { "UInt1x1" } }, + new { Return = "Float1x2", Params = new[] { "UInt1x2" } }, + new { Return = "Float1x3", Params = new[] { "UInt1x3" } }, + new { Return = "Float1x4", Params = new[] { "UInt1x4" } }, + new { Return = "Float2x1", Params = new[] { "UInt2x1" } }, + new { Return = "Float2x2", Params = new[] { "UInt2x2" } }, + new { Return = "Float2x3", Params = new[] { "UInt2x3" } }, + new { Return = "Float2x4", Params = new[] { "UInt2x4" } }, + new { Return = "Float3x1", Params = new[] { "UInt3x1" } }, + new { Return = "Float3x2", Params = new[] { "UInt3x2" } }, + new { Return = "Float3x3", Params = new[] { "UInt3x3" } }, + new { Return = "Float3x4", Params = new[] { "UInt3x4" } }, + new { Return = "Float4x1", Params = new[] { "UInt4x1" } }, + new { Return = "Float4x2", Params = new[] { "UInt4x2" } }, + new { Return = "Float4x3", Params = new[] { "UInt4x3" } }, + new { Return = "Float4x4", Params = new[] { "UInt4x4" } } + }, + IsPure = true + }, + new + { + Name = "Asin", + HlslName = "asin", + Summary = "Returns the arcsine of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The arcsine of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "AsInt", + HlslName = "asint", + Summary = "Interprets the bit pattern of an input value as an integer number.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The input value." } + }, + Returns = "The input interpreted as an integer number.", + Overloads = new[] + { + new { Return = "int", Params = new[] { "float" } }, + new { Return = "Int2", Params = new[] { "Float2" } }, + new { Return = "Int3", Params = new[] { "Float3" } }, + new { Return = "Int4", Params = new[] { "Float4" } }, + new { Return = "Int1x1", Params = new[] { "Float1x1" } }, + new { Return = "Int1x2", Params = new[] { "Float1x2" } }, + new { Return = "Int1x3", Params = new[] { "Float1x3" } }, + new { Return = "Int1x4", Params = new[] { "Float1x4" } }, + new { Return = "Int2x1", Params = new[] { "Float2x1" } }, + new { Return = "Int2x2", Params = new[] { "Float2x2" } }, + new { Return = "Int2x3", Params = new[] { "Float2x3" } }, + new { Return = "Int2x4", Params = new[] { "Float2x4" } }, + new { Return = "Int3x1", Params = new[] { "Float3x1" } }, + new { Return = "Int3x2", Params = new[] { "Float3x2" } }, + new { Return = "Int3x3", Params = new[] { "Float3x3" } }, + new { Return = "Int3x4", Params = new[] { "Float3x4" } }, + new { Return = "Int4x1", Params = new[] { "Float4x1" } }, + new { Return = "Int4x2", Params = new[] { "Float4x2" } }, + new { Return = "Int4x3", Params = new[] { "Float4x3" } }, + new { Return = "Int4x4", Params = new[] { "Float4x4" } }, + new { Return = "int", Params = new[] { "uint" } }, + new { Return = "Int2", Params = new[] { "UInt2" } }, + new { Return = "Int3", Params = new[] { "UInt3" } }, + new { Return = "Int4", Params = new[] { "UInt4" } }, + new { Return = "Int1x1", Params = new[] { "UInt1x1" } }, + new { Return = "Int1x2", Params = new[] { "UInt1x2" } }, + new { Return = "Int1x3", Params = new[] { "UInt1x3" } }, + new { Return = "Int1x4", Params = new[] { "UInt1x4" } }, + new { Return = "Int2x1", Params = new[] { "UInt2x1" } }, + new { Return = "Int2x2", Params = new[] { "UInt2x2" } }, + new { Return = "Int2x3", Params = new[] { "UInt2x3" } }, + new { Return = "Int2x4", Params = new[] { "UInt2x4" } }, + new { Return = "Int3x1", Params = new[] { "UInt3x1" } }, + new { Return = "Int3x2", Params = new[] { "UInt3x2" } }, + new { Return = "Int3x3", Params = new[] { "UInt3x3" } }, + new { Return = "Int3x4", Params = new[] { "UInt3x4" } }, + new { Return = "Int4x1", Params = new[] { "UInt4x1" } }, + new { Return = "Int4x2", Params = new[] { "UInt4x2" } }, + new { Return = "Int4x3", Params = new[] { "UInt4x3" } }, + new { Return = "Int4x4", Params = new[] { "UInt4x4" } } + }, + IsPure = true + }, + new + { + Name = "AsUInt", + HlslName = "asuint", + Summary = "Interprets the bit pattern of an input value as an unsigned integer number.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The input value." } + }, + Returns = "The input interpreted as an unsigned integer number.", + Overloads = new[] + { + new { Return = "uint", Params = new[] { "float" } }, + new { Return = "UInt2", Params = new[] { "Float2" } }, + new { Return = "UInt3", Params = new[] { "Float3" } }, + new { Return = "UInt4", Params = new[] { "Float4" } }, + new { Return = "UInt1x1", Params = new[] { "Float1x1" } }, + new { Return = "UInt1x2", Params = new[] { "Float1x2" } }, + new { Return = "UInt1x3", Params = new[] { "Float1x3" } }, + new { Return = "UInt1x4", Params = new[] { "Float1x4" } }, + new { Return = "UInt2x1", Params = new[] { "Float2x1" } }, + new { Return = "UInt2x2", Params = new[] { "Float2x2" } }, + new { Return = "UInt2x3", Params = new[] { "Float2x3" } }, + new { Return = "UInt2x4", Params = new[] { "Float2x4" } }, + new { Return = "UInt3x1", Params = new[] { "Float3x1" } }, + new { Return = "UInt3x2", Params = new[] { "Float3x2" } }, + new { Return = "UInt3x3", Params = new[] { "Float3x3" } }, + new { Return = "UInt3x4", Params = new[] { "Float3x4" } }, + new { Return = "UInt4x1", Params = new[] { "Float4x1" } }, + new { Return = "UInt4x2", Params = new[] { "Float4x2" } }, + new { Return = "UInt4x3", Params = new[] { "Float4x3" } }, + new { Return = "UInt4x4", Params = new[] { "Float4x4" } }, + new { Return = "uint", Params = new[] { "int" } }, + new { Return = "UInt2", Params = new[] { "Int2" } }, + new { Return = "UInt3", Params = new[] { "Int3" } }, + new { Return = "UInt4", Params = new[] { "Int4" } }, + new { Return = "UInt1x1", Params = new[] { "Int1x1" } }, + new { Return = "UInt1x2", Params = new[] { "Int1x2" } }, + new { Return = "UInt1x3", Params = new[] { "Int1x3" } }, + new { Return = "UInt1x4", Params = new[] { "Int1x4" } }, + new { Return = "UInt2x1", Params = new[] { "Int2x1" } }, + new { Return = "UInt2x2", Params = new[] { "Int2x2" } }, + new { Return = "UInt2x3", Params = new[] { "Int2x3" } }, + new { Return = "UInt2x4", Params = new[] { "Int2x4" } }, + new { Return = "UInt3x1", Params = new[] { "Int3x1" } }, + new { Return = "UInt3x2", Params = new[] { "Int3x2" } }, + new { Return = "UInt3x3", Params = new[] { "Int3x3" } }, + new { Return = "UInt3x4", Params = new[] { "Int3x4" } }, + new { Return = "UInt4x1", Params = new[] { "Int4x1" } }, + new { Return = "UInt4x2", Params = new[] { "Int4x2" } }, + new { Return = "UInt4x3", Params = new[] { "Int4x3" } }, + new { Return = "UInt4x4", Params = new[] { "Int4x4" } } + }, + IsPure = true + }, + new + { + Name = "Atan", + HlslName = "atan", + Summary = "Returns the arctangent of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The arctangent of the {x} parameter. This value is within the range [-π/2, π/2].", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Atan2", + HlslName = "atan2", + Summary = "Returns the arctangent of two values (y, x).", + Parameters = new[] + { + new { IsOut = false, Name = "y", Info = "The y value." }, + new { IsOut = false, Name = "x", Info = "The x value." } + }, + Returns = "The arctangent of ({y}, {x}).", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Ceil", + HlslName = "ceil", + Summary = "Returns the smallest integer value that is greater than or equal to the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The smallest integer value (returned as a floating-point type) that is greater than or equal to the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Clamp", + HlslName = "clamp", + Summary = "Clamps the specified value to the specified minimum and maximum range.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The value to clamp." }, + new { IsOut = false, Name = "min", Info = "The specified minimum range." }, + new { IsOut = false, Name = "max", Info = "The specified maximum range." } + }, + Returns = "The clamped value for the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4", "Float4x4" } }, + new { Return = "int", Params = new[] { "int", "int", "int" } }, + new { Return = "Int2", Params = new[] { "Int2", "Int2", "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3", "Int3", "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4", "Int4", "Int4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1", "Int1x1", "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2", "Int1x2", "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3", "Int1x3", "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4", "Int1x4", "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1", "Int2x1", "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2", "Int2x2", "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3", "Int2x3", "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4", "Int2x4", "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1", "Int3x1", "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2", "Int3x2", "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3", "Int3x3", "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4", "Int3x4", "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1", "Int4x1", "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2", "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3", "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4", "Int4x4" } } + }, + IsPure = true + }, + new + { + Name = "Cos", + HlslName = "cos", + Summary = "Returns the cosine of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value, in radians." } + }, + Returns = "The cosine of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Cosh", + HlslName = "cosh", + Summary = "Returns the hyperbolic cosine of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value, in radians." } + }, + Returns = "The hyperbolic cosine of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "CountBits", + HlslName = "countbits", + Summary = "Counts the number of bits (per component) in the input integer.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The input value." } + }, + Returns = "The number of bits.", + Overloads = new[] + { + new { Return = "uint", Params = new[] { "uint" } }, + new { Return = "UInt2", Params = new[] { "UInt2" } }, + new { Return = "UInt3", Params = new[] { "UInt3" } }, + new { Return = "UInt4", Params = new[] { "UInt4" } } + }, + IsPure = true + }, + new + { + Name = "Cross", + HlslName = "cross", + Summary = "Returns the cross product of two floating-point, 3D vectors.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The first floating-point, 3D vector." }, + new { IsOut = false, Name = "y", Info = "The second floating-point, 3D vector." } + }, + Returns = "The number of bits.", + Overloads = new[] + { + new { Return = "Float3", Params = new[] { "Float3", "Float3" } } + }, + IsPure = true + }, + new + { + Name = "Degrees", + HlslName = "degrees", + Summary = "Converts the specified value from radians to degrees.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The result of converting the {x} parameter from radians to degrees.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Determinant", + HlslName = "determinant", + Summary = "Returns the determinant of the specified floating-point, square matrix.", + Parameters = new[] + { + new { IsOut = false, Name = "m", Info = "The specified value." } + }, + Returns = "The floating-point, scalar value that represents the determinant of the {m} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "Float1x1" } }, + new { Return = "float", Params = new[] { "Float2x2" } }, + new { Return = "float", Params = new[] { "Float3x3" } }, + new { Return = "float", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Distance", + HlslName = "distance", + Summary = "Returns a distance scalar between two vectors.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The first floating-point vector to compare." }, + new { IsOut = false, Name = "y", Info = "The second floating-point vector to compare." } + }, + Returns = "A floating-point, scalar value that represents the distance between the {x} parameter and the {y} parameter.", + Overloads = new[] + { + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } } + }, + IsPure = true + }, + new + { + Name = "Dot", + HlslName = "dot", + Summary = "Returns the dot product of two vectors.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The first vector." }, + new { IsOut = false, Name = "y", Info = "The second vector." } + }, + Returns = "The dot product of the {x} parameter and the {y} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "Float2", "Float2" } }, + new { Return = "float", Params = new[] { "Float3", "Float3" } }, + new { Return = "float", Params = new[] { "Float4", "Float4" } }, + new { Return = "float", Params = new[] { "Int2", "Int2" } }, + new { Return = "float", Params = new[] { "Int3", "Int3" } }, + new { Return = "float", Params = new[] { "Int4", "Int4" } } + }, + IsPure = true + }, + new + { + Name = "Exp", + HlslName = "exp", + Summary = "Returns the base-e exponential of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The base-e exponential of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Exp2", + HlslName = "exp2", + Summary = "Returns the base-2 exponential of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The base-2 exponential of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "FirstBitHigh", + HlslName = "firstbithigh", + Summary = "Gets the location of the first set bit starting from the highest order bit and working downward, per component.", + Parameters = new[] + { + new { IsOut = false, Name = "value", Info = "The input value." } + }, + Returns = "The location of the first set bit.", + Overloads = new[] + { + new { Return = "int", Params = new[] { "int" } }, + new { Return = "Int2", Params = new[] { "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4" } }, + new { Return = "uint", Params = new[] { "uint" } }, + new { Return = "UInt2", Params = new[] { "UInt2" } }, + new { Return = "UInt3", Params = new[] { "UInt3" } }, + new { Return = "UInt4", Params = new[] { "UInt4" } } + }, + IsPure = true + }, + new + { + Name = "FirstBitLow", + HlslName = "firstbitlow", + Summary = "Returns the location of the first set bit starting from the lowest order bit and working upward, per component.", + Parameters = new[] + { + new { IsOut = false, Name = "value", Info = "The input value." } + }, + Returns = "The location of the first set bit.", + Overloads = new[] + { + new { Return = "int", Params = new[] { "int" } }, + new { Return = "Int2", Params = new[] { "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4" } }, + new { Return = "uint", Params = new[] { "uint" } }, + new { Return = "UInt2", Params = new[] { "UInt2" } }, + new { Return = "UInt3", Params = new[] { "UInt3" } }, + new { Return = "UInt4", Params = new[] { "UInt4" } } + }, + IsPure = true + }, + new + { + Name = "Floor", + HlslName = "floor", + Summary = "Returns the largest integer that is less than or equal to the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The largest integer value (returned as a floating-point type) that is less than or equal to the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "FusedMultiplyAccumulate", + HlslName = "fma", + Summary = "Returns the double-precision fused multiply-addition of a * b + c.", + Parameters = new[] + { + new { IsOut = false, Name = "a", Info = "The first value in the fused multiply-addition." }, + new { IsOut = false, Name = "b", Info = "The second value in the fused multiply-addition." }, + new { IsOut = false, Name = "c", Info = "The third value in the fused multiply-addition." } + }, + Returns = "The double-precision fused multiply-addition of parameters a * b + c. The returned value must be accurate to 0.5 units of least precision (ULP).", + Overloads = new[] + { + new { Return = "double", Params = new[] { "double", "double", "double" } }, + new { Return = "Double2", Params = new[] { "Double2", "Double2", "Double2" } }, + new { Return = "Double3", Params = new[] { "Double3", "Double3", "Double3" } }, + new { Return = "Double4", Params = new[] { "Double4", "Double4", "Double4" } }, + new { Return = "Double1x1", Params = new[] { "Double1x1", "Double1x1", "Double1x1" } }, + new { Return = "Double1x2", Params = new[] { "Double1x2", "Double1x2", "Double1x2" } }, + new { Return = "Double1x3", Params = new[] { "Double1x3", "Double1x3", "Double1x3" } }, + new { Return = "Double1x4", Params = new[] { "Double1x4", "Double1x4", "Double1x4" } }, + new { Return = "Double2x1", Params = new[] { "Double2x1", "Double2x1", "Double2x1" } }, + new { Return = "Double2x2", Params = new[] { "Double2x2", "Double2x2", "Double2x2" } }, + new { Return = "Double2x3", Params = new[] { "Double2x3", "Double2x3", "Double2x3" } }, + new { Return = "Double2x4", Params = new[] { "Double2x4", "Double2x4", "Double2x4" } }, + new { Return = "Double3x1", Params = new[] { "Double3x1", "Double3x1", "Double3x1" } }, + new { Return = "Double3x2", Params = new[] { "Double3x2", "Double3x2", "Double3x2" } }, + new { Return = "Double3x3", Params = new[] { "Double3x3", "Double3x3", "Double3x3" } }, + new { Return = "Double3x4", Params = new[] { "Double3x4", "Double3x4", "Double3x4" } }, + new { Return = "Double4x1", Params = new[] { "Double4x1", "Double4x1", "Double4x1" } }, + new { Return = "Double4x2", Params = new[] { "Double4x2", "Double4x2", "Double4x2" } }, + new { Return = "Double4x3", Params = new[] { "Double4x3", "Double4x3", "Double4x3" } }, + new { Return = "Double4x4", Params = new[] { "Double4x4", "Double4x4", "Double4x4" } } + }, + IsPure = true + }, + new + { + Name = "Fmod", + HlslName = "fmod", + Summary = "Returns the floating-point remainder of x / y.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The floating-point dividend." }, + new { IsOut = false, Name = "y", Info = "The floating-point divisor." } + }, + Returns = "The floating-point remainder of the x parameter divided by the y parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Frac", + HlslName = "frac", + Summary = "Returns the fractional (or decimal) part of the input which is greater than or equal to 0 and less than 1.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The fractional part of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Frexp", + HlslName = "frexp", + Summary = "Returns the mantissa and exponent of the specified floating-point value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified floating-point value." }, + new { IsOut = true, Name = "exp", Info = "The returned exponent of the input parameter." } + }, + Returns = "The mantissa of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } } + }, + IsPure = false + }, + new + { + Name = "IsFinite", + HlslName = "isfinite", + Summary = "Determines if the specified floating-point value is finite.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "Returns a value of the same size as {x}, indicaating whether each component is finite.", + Overloads = new[] + { + new { Return = "bool", Params = new[] { "float" } }, + new { Return = "Bool2", Params = new[] { "Float2" } }, + new { Return = "Bool3", Params = new[] { "Float3" } }, + new { Return = "Bool4", Params = new[] { "Float4" } }, + new { Return = "Bool1x1", Params = new[] { "Float1x1" } }, + new { Return = "Bool1x2", Params = new[] { "Float1x2" } }, + new { Return = "Bool1x3", Params = new[] { "Float1x3" } }, + new { Return = "Bool1x4", Params = new[] { "Float1x4" } }, + new { Return = "Bool2x1", Params = new[] { "Float2x1" } }, + new { Return = "Bool2x2", Params = new[] { "Float2x2" } }, + new { Return = "Bool2x3", Params = new[] { "Float2x3" } }, + new { Return = "Bool2x4", Params = new[] { "Float2x4" } }, + new { Return = "Bool3x1", Params = new[] { "Float3x1" } }, + new { Return = "Bool3x2", Params = new[] { "Float3x2" } }, + new { Return = "Bool3x3", Params = new[] { "Float3x3" } }, + new { Return = "Bool3x4", Params = new[] { "Float3x4" } }, + new { Return = "Bool4x1", Params = new[] { "Float4x1" } }, + new { Return = "Bool4x2", Params = new[] { "Float4x2" } }, + new { Return = "Bool4x3", Params = new[] { "Float4x3" } }, + new { Return = "Bool4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "IsInfinite", + HlslName = "isinf", + Summary = "Determines if the specified value is infinite.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "Returns a value of the same size as {x}, indicaating whether each component is infinite.", + Overloads = new[] + { + new { Return = "bool", Params = new[] { "float" } }, + new { Return = "Bool2", Params = new[] { "Float2" } }, + new { Return = "Bool3", Params = new[] { "Float3" } }, + new { Return = "Bool4", Params = new[] { "Float4" } }, + new { Return = "Bool1x1", Params = new[] { "Float1x1" } }, + new { Return = "Bool1x2", Params = new[] { "Float1x2" } }, + new { Return = "Bool1x3", Params = new[] { "Float1x3" } }, + new { Return = "Bool1x4", Params = new[] { "Float1x4" } }, + new { Return = "Bool2x1", Params = new[] { "Float2x1" } }, + new { Return = "Bool2x2", Params = new[] { "Float2x2" } }, + new { Return = "Bool2x3", Params = new[] { "Float2x3" } }, + new { Return = "Bool2x4", Params = new[] { "Float2x4" } }, + new { Return = "Bool3x1", Params = new[] { "Float3x1" } }, + new { Return = "Bool3x2", Params = new[] { "Float3x2" } }, + new { Return = "Bool3x3", Params = new[] { "Float3x3" } }, + new { Return = "Bool3x4", Params = new[] { "Float3x4" } }, + new { Return = "Bool4x1", Params = new[] { "Float4x1" } }, + new { Return = "Bool4x2", Params = new[] { "Float4x2" } }, + new { Return = "Bool4x3", Params = new[] { "Float4x3" } }, + new { Return = "Bool4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "IsNaN", + HlslName = "isnan", + Summary = "Determines if the specified value is NAN or QNAN.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "Returns a value of the same size as {x}, indicaating whether each component is NAN or QNAN.", + Overloads = new[] + { + new { Return = "bool", Params = new[] { "float" } }, + new { Return = "Bool2", Params = new[] { "Float2" } }, + new { Return = "Bool3", Params = new[] { "Float3" } }, + new { Return = "Bool4", Params = new[] { "Float4" } }, + new { Return = "Bool1x1", Params = new[] { "Float1x1" } }, + new { Return = "Bool1x2", Params = new[] { "Float1x2" } }, + new { Return = "Bool1x3", Params = new[] { "Float1x3" } }, + new { Return = "Bool1x4", Params = new[] { "Float1x4" } }, + new { Return = "Bool2x1", Params = new[] { "Float2x1" } }, + new { Return = "Bool2x2", Params = new[] { "Float2x2" } }, + new { Return = "Bool2x3", Params = new[] { "Float2x3" } }, + new { Return = "Bool2x4", Params = new[] { "Float2x4" } }, + new { Return = "Bool3x1", Params = new[] { "Float3x1" } }, + new { Return = "Bool3x2", Params = new[] { "Float3x2" } }, + new { Return = "Bool3x3", Params = new[] { "Float3x3" } }, + new { Return = "Bool3x4", Params = new[] { "Float3x4" } }, + new { Return = "Bool4x1", Params = new[] { "Float4x1" } }, + new { Return = "Bool4x2", Params = new[] { "Float4x2" } }, + new { Return = "Bool4x3", Params = new[] { "Float4x3" } }, + new { Return = "Bool4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Ldexp", + HlslName = "ldexp", + Summary = "Returns the result of multiplying the specified value by two, raised to the power of the specified exponent.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." }, + new { IsOut = false, Name = "exp", Info = "The specified exponent." } + }, + Returns = "The result of multiplying the {x} parameter by two, raised to the power of the {exp} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Length", + HlslName = "length", + Summary = "Returns the length of the specified floating-point vector.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified floating-point vector." } + }, + Returns = "A floating-point scalar that represents the length of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "Float2" } }, + new { Return = "float", Params = new[] { "Float3" } }, + new { Return = "float", Params = new[] { "Float4" } } + }, + IsPure = true + }, + new + { + Name = "Lerp", + HlslName = "lerp", + Summary = "Performs a linear interpolation.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The first-floating point value." }, + new { IsOut = false, Name = "min", Info = "The second-floating point value." }, + new { IsOut = false, Name = "max", Info = "A value that linearly interpolates between the two inputs." } + }, + Returns = "The result of the linear interpolation.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Log", + HlslName = "log", + Summary = "Returns the base-e logarithm of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The base-e logarithm of the {x} parameter. If the {x} parameter is negative, this function returns indefinite. If the {x} parameter is 0, this function returns negative infinity.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Log10", + HlslName = "log10", + Summary = "Returns the base-10 logarithm of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The base-10 logarithm of the {x} parameter. If the {x} parameter is negative, this function returns indefinite. If the {x} parameter is 0, this function returns negative infinity.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Log2", + HlslName = "log2", + Summary = "Returns the base-2 logarithm of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The base-2 logarithm of the {x} parameter. If the {x} parameter is negative, this function returns indefinite. If the {x} parameter is 0, this function returns negative infinity.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Max", + HlslName = "max", + Summary = "Selects the greater between two inputs.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The first input value." }, + new { IsOut = false, Name = "y", Info = "The second input value." } + }, + Returns = "The {x} or {y} parameter, whichever is the largest value.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }, + new { Return = "int", Params = new[] { "int", "int" } }, + new { Return = "Int2", Params = new[] { "Int2", "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3", "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4", "Int4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1", "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2", "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3", "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4", "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1", "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2", "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3", "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4", "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1", "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2", "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3", "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4", "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1", "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } } + }, + IsPure = true + }, + new + { + Name = "Min", + HlslName = "min", + Summary = "Selects the lesser between two inputs.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The first input value." }, + new { IsOut = false, Name = "y", Info = "The second input value." } + }, + Returns = "The {x} or {y} parameter, whichever is the smallest value.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }, + new { Return = "int", Params = new[] { "int", "int" } }, + new { Return = "Int2", Params = new[] { "Int2", "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3", "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4", "Int4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1", "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2", "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3", "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4", "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1", "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2", "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3", "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4", "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1", "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2", "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3", "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4", "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1", "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } } + }, + IsPure = true + }, + new + { + Name = "Modf", + HlslName = "modf", + Summary = "Splits a value into fractional and integer parts, each with the same sign as the input value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The input value." }, + new { IsOut = true, Name = "y", Info = "The resulting integer portion." } + }, + Returns = "The signed-fractional portion of {x}.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }, + new { Return = "int", Params = new[] { "int", "int" } }, + new { Return = "Int2", Params = new[] { "Int2", "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3", "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4", "Int4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1", "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2", "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3", "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4", "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1", "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2", "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3", "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4", "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1", "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2", "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3", "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4", "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1", "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } } + }, + IsPure = true + }, + new + { + Name = "Mul", + HlslName = "mul", + Summary = "Multiplies two values using matrix math.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The first input value." }, + new { IsOut = false, Name = "y", Info = "The second input value." } + }, + Returns = "The result of {x} times {y}. The result has the dimension {x}-rows by {y}-columns.", + Overloads = new[] + { + // 1 (scalars) + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "int", Params = new[] { "int", "int" } }, + + // 2 (scalar by vector) + new { Return = "Float2", Params = new[] { "float", "Float2" } }, + new { Return = "Float3", Params = new[] { "float", "Float3" } }, + new { Return = "Float4", Params = new[] { "float", "Float4" } }, + new { Return = "Int2", Params = new[] { "int", "Int2" } }, + new { Return = "Int3", Params = new[] { "int", "Int3" } }, + new { Return = "Int4", Params = new[] { "int", "Int4" } }, + + // 3 (scalar by matrix) + new { Return = "Float1x1", Params = new[] { "float", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "float", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "float", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "float", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "float", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "float", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "float", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "float", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "float", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "float", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "float", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "float", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "float", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "float", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "float", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "float", "Float4x4" } }, + new { Return = "Int1x1", Params = new[] { "int", "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "int", "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "int", "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "int", "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "int", "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "int", "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "int", "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "int", "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "int", "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "int", "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "int", "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "int", "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "int", "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "int", "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "int", "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "int", "Int4x4" } }, + + // 4 (vector by scalar) + new { Return = "Float2", Params = new[] { "Float2", "float" } }, + new { Return = "Float3", Params = new[] { "Float3", "float" } }, + new { Return = "Float4", Params = new[] { "Float4", "float" } }, + new { Return = "Int2", Params = new[] { "Int2", "int" } }, + new { Return = "Int3", Params = new[] { "Int3", "int" } }, + new { Return = "Int4", Params = new[] { "Int4", "int" } }, + + // 5 (vector by vector) + new { Return = "float", Params = new[] { "Float2", "Float2" } }, + new { Return = "float", Params = new[] { "Float3", "Float3" } }, + new { Return = "float", Params = new[] { "Float4", "Float4" } }, + new { Return = "int", Params = new[] { "Int2", "Int2" } }, + new { Return = "int", Params = new[] { "Int3", "Int3" } }, + new { Return = "int", Params = new[] { "Int4", "Int4" } }, + + // 6 (vector by matrix) + new { Return = "float", Params = new[] { "Float2", "Float2x1" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2x2" } }, + new { Return = "Float3", Params = new[] { "Float2", "Float2x3" } }, + new { Return = "Float4", Params = new[] { "Float2", "Float2x4" } }, + new { Return = "float", Params = new[] { "Float3", "Float3x1" } }, + new { Return = "Float2", Params = new[] { "Float3", "Float3x2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3x3" } }, + new { Return = "Float4", Params = new[] { "Float3", "Float3x4" } }, + new { Return = "float", Params = new[] { "Float4", "Float4x1" } }, + new { Return = "Float2", Params = new[] { "Float4", "Float4x2" } }, + new { Return = "Float3", Params = new[] { "Float4", "Float4x3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4x4" } }, + new { Return = "int", Params = new[] { "Int2", "Int2x1" } }, + new { Return = "Int2", Params = new[] { "Int2", "Int2x2" } }, + new { Return = "Int3", Params = new[] { "Int2", "Int2x3" } }, + new { Return = "Int4", Params = new[] { "Int2", "Int2x4" } }, + new { Return = "int", Params = new[] { "Int3", "Int3x1" } }, + new { Return = "Int2", Params = new[] { "Int3", "Int3x2" } }, + new { Return = "Int3", Params = new[] { "Int3", "Int3x3" } }, + new { Return = "Int4", Params = new[] { "Int3", "Int3x4" } }, + new { Return = "int", Params = new[] { "Int4", "Int4x1" } }, + new { Return = "Int2", Params = new[] { "Int4", "Int4x2" } }, + new { Return = "Int3", Params = new[] { "Int4", "Int4x3" } }, + new { Return = "Int4", Params = new[] { "Int4", "Int4x4" } }, + + // 7 (matrix by scalar) + new { Return = "Float1x1", Params = new[] { "Float1x1", "float" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "float" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "float" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "float" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "float" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "float" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "float" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "float" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "float" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "float" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "float" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "float" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "float" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "float" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "float" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "float" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1", "int" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2", "int" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3", "int" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4", "int" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1", "int" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2", "int" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3", "int" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4", "int" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1", "int" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2", "int" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3", "int" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4", "int" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1", "int" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2", "int" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3", "int" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4", "int" } }, + + // 8 (matrix by vector) + new { Return = "float", Params = new[] { "Float1x2", "Float2" } }, + new { Return = "float", Params = new[] { "Float1x3", "Float3" } }, + new { Return = "float", Params = new[] { "Float1x4", "Float4" } }, + new { Return = "Float2", Params = new[] { "Float2x2", "Float2" } }, + new { Return = "Float2", Params = new[] { "Float2x3", "Float3" } }, + new { Return = "Float2", Params = new[] { "Float2x4", "Float4" } }, + new { Return = "Float3", Params = new[] { "Float3x2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3x3", "Float3" } }, + new { Return = "Float3", Params = new[] { "Float3x4", "Float4" } }, + new { Return = "Float4", Params = new[] { "Float4x2", "Float2" } }, + new { Return = "Float4", Params = new[] { "Float4x3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4x4", "Float4" } }, + new { Return = "int", Params = new[] { "Int1x2", "Int2" } }, + new { Return = "int", Params = new[] { "Int1x3", "Int3" } }, + new { Return = "int", Params = new[] { "Int1x4", "Int4" } }, + new { Return = "Int2", Params = new[] { "Int2x2", "Int2" } }, + new { Return = "Int2", Params = new[] { "Int2x3", "Int3" } }, + new { Return = "Int2", Params = new[] { "Int2x4", "Int4" } }, + new { Return = "Int3", Params = new[] { "Int3x2", "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3x3", "Int3" } }, + new { Return = "Int3", Params = new[] { "Int3x4", "Int4" } }, + new { Return = "Int4", Params = new[] { "Int4x2", "Int2" } }, + new { Return = "Int4", Params = new[] { "Int4x3", "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4x4", "Int4" } }, + + // 9 (matrix by matrix) + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x1", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x1", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x1", "Float1x4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x2", "Float2x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float2x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x2", "Float2x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x2", "Float2x4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x3", "Float3x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x3", "Float3x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float3x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x3", "Float3x4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x4", "Float4x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x4", "Float4x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x4", "Float4x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float4x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float1x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x1", "Float1x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x1", "Float1x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x1", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x2", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x2", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x2", "Float2x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x3", "Float3x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x3", "Float3x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float3x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x3", "Float3x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x4", "Float4x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x4", "Float4x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x4", "Float4x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float4x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float1x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x1", "Float1x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x1", "Float1x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x1", "Float1x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x2", "Float2x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float2x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x2", "Float2x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x2", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x3", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x3", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x3", "Float3x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x4", "Float4x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x4", "Float4x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x4", "Float4x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float4x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float1x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x1", "Float1x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x1", "Float1x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x1", "Float1x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x2", "Float2x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float2x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x2", "Float2x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x2", "Float2x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x3", "Float3x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x3", "Float3x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float3x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x3", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x4", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x4", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x4", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1", "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x1", "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x1", "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x1", "Int1x4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x2", "Int2x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2", "Int2x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x2", "Int2x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x2", "Int2x4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x3", "Int3x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x3", "Int3x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3", "Int3x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x3", "Int3x4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x4", "Int4x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x4", "Int4x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x4", "Int4x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4", "Int4x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1", "Int1x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x1", "Int1x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x1", "Int1x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x1", "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x2", "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2", "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x2", "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x2", "Int2x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x3", "Int3x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x3", "Int3x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3", "Int3x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x3", "Int3x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x4", "Int4x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x4", "Int4x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x4", "Int4x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4", "Int4x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1", "Int1x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x1", "Int1x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x1", "Int1x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x1", "Int1x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x2", "Int2x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2", "Int2x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x2", "Int2x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x2", "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x3", "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x3", "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3", "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x3", "Int3x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x4", "Int4x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x4", "Int4x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x4", "Int4x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4", "Int4x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1", "Int1x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x1", "Int1x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x1", "Int1x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x1", "Int1x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x2", "Int2x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2", "Int2x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x2", "Int2x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x2", "Int2x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x3", "Int3x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x3", "Int3x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3", "Int3x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x3", "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x4", "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x4", "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x4", "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } }, + }, + IsPure = true + }, + new + { + Name = "Noise", + HlslName = "noise", + Summary = "Generates a random value using the Perlin-noise algorithm.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "A floating-point vector from which to generate Perlin noise." } + }, + Returns = "The Perlin noise value within a range between -1 and 1.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "Float2" } }, + new { Return = "float", Params = new[] { "Float3" } }, + new { Return = "float", Params = new[] { "Float4" } } + }, + IsPure = true + }, + new + { + Name = "Normalize", + HlslName = "normalize", + Summary = "Normalizes the specified floating-point vector according to x / length(x).", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified floating-point vector." } + }, + Returns = "The normalized {x} parameter. If the length of the {x} parameter is 0, the result is indefinite.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "Float2" } }, + new { Return = "float", Params = new[] { "Float3" } }, + new { Return = "float", Params = new[] { "Float4" } } + }, + IsPure = true + }, + new + { + Name = "Pow", + HlslName = "pow", + Summary = "Returns the specified value raised to the specified power.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." }, + new { IsOut = false, Name = "y", Info = "The specified power." } + }, + Returns = "The {x} parameter raised to the power of the {y} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Radians", + HlslName = "radians", + Summary = "Converts the specified value from degrees to radians.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The {x} parameter converted from degrees to radians.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Rcp", + HlslName = "rcp", + Summary = "Calculates a fast, approximate, per-component reciprocal.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The input value." } + }, + Returns = "The reciprocal of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } }, + new { Return = "double", Params = new[] { "double" } }, + new { Return = "Double2", Params = new[] { "Double2" } }, + new { Return = "Double3", Params = new[] { "Double3" } }, + new { Return = "Double4", Params = new[] { "Double4" } }, + new { Return = "Double1x1", Params = new[] { "Double1x1" } }, + new { Return = "Double1x2", Params = new[] { "Double1x2" } }, + new { Return = "Double1x3", Params = new[] { "Double1x3" } }, + new { Return = "Double1x4", Params = new[] { "Double1x4" } }, + new { Return = "Double2x1", Params = new[] { "Double2x1" } }, + new { Return = "Double2x2", Params = new[] { "Double2x2" } }, + new { Return = "Double2x3", Params = new[] { "Double2x3" } }, + new { Return = "Double2x4", Params = new[] { "Double2x4" } }, + new { Return = "Double3x1", Params = new[] { "Double3x1" } }, + new { Return = "Double3x2", Params = new[] { "Double3x2" } }, + new { Return = "Double3x3", Params = new[] { "Double3x3" } }, + new { Return = "Double3x4", Params = new[] { "Double3x4" } }, + new { Return = "Double4x1", Params = new[] { "Double4x1" } }, + new { Return = "Double4x2", Params = new[] { "Double4x2" } }, + new { Return = "Double4x3", Params = new[] { "Double4x3" } }, + new { Return = "Double4x4", Params = new[] { "Double4x4" } } + }, + IsPure = true + }, + new + { + Name = "ReverseBits", + HlslName = "reversebits", + Summary = "Reverses the order of the bits, per component.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The input value." } + }, + Returns = "The input value, with the bit order reversed.", + Overloads = new[] + { + new { Return = "uint", Params = new[] { "uint" } }, + new { Return = "UInt2", Params = new[] { "UInt2" } }, + new { Return = "UInt3", Params = new[] { "UInt3" } }, + new { Return = "UInt4", Params = new[] { "UInt4" } } + }, + IsPure = true + }, + new + { + Name = "Round", + HlslName = "round", + Summary = "Rounds the specified value to the nearest integer. Halfway cases are rounded to the nearest even.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The {x} parameter, rounded to the nearest integer within a floating-point type.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Rsqrt", + HlslName = "rsqrt", + Summary = "Returns the reciprocal of the square root of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The reciprocal of the square root of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Saturate", + HlslName = "saturate", + Summary = "Clamps the specified value within the range of 0 to 1.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "The {x} parameter, clamped within the range of 0 to 1.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Sign", + HlslName = "sign", + Summary = "Returns the sign of the input value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value." } + }, + Returns = "Returns -1 if {x} is less than zero; 0 if {x} equals zero; and 1 if {x} is greater than zero.", + Overloads = new[] + { + new { Return = "int", Params = new[] { "float" } }, + new { Return = "Int2", Params = new[] { "Float2" } }, + new { Return = "Int3", Params = new[] { "Float3" } }, + new { Return = "Int4", Params = new[] { "Float4" } }, + new { Return = "Int1x1", Params = new[] { "Float1x1" } }, + new { Return = "Int1x2", Params = new[] { "Float1x2" } }, + new { Return = "Int1x3", Params = new[] { "Float1x3" } }, + new { Return = "Int1x4", Params = new[] { "Float1x4" } }, + new { Return = "Int2x1", Params = new[] { "Float2x1" } }, + new { Return = "Int2x2", Params = new[] { "Float2x2" } }, + new { Return = "Int2x3", Params = new[] { "Float2x3" } }, + new { Return = "Int2x4", Params = new[] { "Float2x4" } }, + new { Return = "Int3x1", Params = new[] { "Float3x1" } }, + new { Return = "Int3x2", Params = new[] { "Float3x2" } }, + new { Return = "Int3x3", Params = new[] { "Float3x3" } }, + new { Return = "Int3x4", Params = new[] { "Float3x4" } }, + new { Return = "Int4x1", Params = new[] { "Float4x1" } }, + new { Return = "Int4x2", Params = new[] { "Float4x2" } }, + new { Return = "Int4x3", Params = new[] { "Float4x3" } }, + new { Return = "Int4x4", Params = new[] { "Float4x4" } }, + new { Return = "int", Params = new[] { "int" } }, + new { Return = "Int2", Params = new[] { "Int2" } }, + new { Return = "Int3", Params = new[] { "Int3" } }, + new { Return = "Int4", Params = new[] { "Int4" } }, + new { Return = "Int1x1", Params = new[] { "Int1x1" } }, + new { Return = "Int1x2", Params = new[] { "Int1x2" } }, + new { Return = "Int1x3", Params = new[] { "Int1x3" } }, + new { Return = "Int1x4", Params = new[] { "Int1x4" } }, + new { Return = "Int2x1", Params = new[] { "Int2x1" } }, + new { Return = "Int2x2", Params = new[] { "Int2x2" } }, + new { Return = "Int2x3", Params = new[] { "Int2x3" } }, + new { Return = "Int2x4", Params = new[] { "Int2x4" } }, + new { Return = "Int3x1", Params = new[] { "Int3x1" } }, + new { Return = "Int3x2", Params = new[] { "Int3x2" } }, + new { Return = "Int3x3", Params = new[] { "Int3x3" } }, + new { Return = "Int3x4", Params = new[] { "Int3x4" } }, + new { Return = "Int4x1", Params = new[] { "Int4x1" } }, + new { Return = "Int4x2", Params = new[] { "Int4x2" } }, + new { Return = "Int4x3", Params = new[] { "Int4x3" } }, + new { Return = "Int4x4", Params = new[] { "Int4x4" } } + }, + IsPure = true + }, + new + { + Name = "Sin", + HlslName = "sin", + Summary = "Returns the sine of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value, in radians." } + }, + Returns = "The sine of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "SinCos", + HlslName = "sincos", + Summary = "Returns the sine and cosine of a specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value, in radians." }, + new { IsOut = true, Name = "sin", Info = "The resulting sine." }, + new { IsOut = true, Name = "cos", Info = "The resulting cosine." } + }, + Returns = string.Empty, + Overloads = new[] + { + new { Return = "void", Params = new[] { "float", "float", "float" } }, + new { Return = "void", Params = new[] { "Float2", "Float2", "Float2" } }, + new { Return = "void", Params = new[] { "Float3", "Float3", "Float3" } }, + new { Return = "void", Params = new[] { "Float4", "Float4", "Float4" } }, + new { Return = "void", Params = new[] { "Float1x1", "Float1x1", "Float1x1" } }, + new { Return = "void", Params = new[] { "Float1x2", "Float1x2", "Float1x2" } }, + new { Return = "void", Params = new[] { "Float1x3", "Float1x3", "Float1x3" } }, + new { Return = "void", Params = new[] { "Float1x4", "Float1x4", "Float1x4" } }, + new { Return = "void", Params = new[] { "Float2x1", "Float2x1", "Float2x1" } }, + new { Return = "void", Params = new[] { "Float2x2", "Float2x2", "Float2x2" } }, + new { Return = "void", Params = new[] { "Float2x3", "Float2x3", "Float2x3" } }, + new { Return = "void", Params = new[] { "Float2x4", "Float2x4", "Float2x4" } }, + new { Return = "void", Params = new[] { "Float3x1", "Float3x1", "Float3x1" } }, + new { Return = "void", Params = new[] { "Float3x2", "Float3x2", "Float3x2" } }, + new { Return = "void", Params = new[] { "Float3x3", "Float3x3", "Float3x3" } }, + new { Return = "void", Params = new[] { "Float3x4", "Float3x4", "Float3x4" } }, + new { Return = "void", Params = new[] { "Float4x1", "Float4x1", "Float4x1" } }, + new { Return = "void", Params = new[] { "Float4x2", "Float4x2", "Float4x2" } }, + new { Return = "void", Params = new[] { "Float4x3", "Float4x3", "Float4x3" } }, + new { Return = "void", Params = new[] { "Float4x4", "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Sinh", + HlslName = "sinh", + Summary = "Returns the hyperbolic sine of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value, in radians." } + }, + Returns = "The hyperbolic sine of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "SmoothStep", + HlslName = "smoothstep", + Summary = "Returns a smooth Hermite interpolation between 0 and 1 if the specified value is in the input range.", + Parameters = new[] + { + new { IsOut = false, Name = "min", Info = "The specified minimum range." }, + new { IsOut = false, Name = "max", Info = "The specified maximum range." }, + new { IsOut = false, Name = "x", Info = "The specified value to be interpolated." } + }, + Returns = "Returns 0 if {x} is less than {min}; 1 if {x} is greater than {max}; otherwise, a value between 0 and 1 if {x} is in the range [{min}, {max}].", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Sqrt", + HlslName = "sqrt", + Summary = "Returns the square root of the specified floating-point value, per component.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified floating-point value." } + }, + Returns = "The square root of the {x} parameter, per component.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Step", + HlslName = "step", + Summary = "Compares two values, returning 0 or 1 based on which value is greater.", + Parameters = new[] + { + new { IsOut = false, Name = "y", Info = "The first specified floating-point value." }, + new { IsOut = false, Name = "x", Info = "The second specified floating-point value." } + }, + Returns = "1 if the {x} parameter is greater than or equal to the {y} parameter; otherwise, 0.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float", "float" } }, + new { Return = "Float2", Params = new[] { "Float2", "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3", "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4", "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1", "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2", "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3", "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4", "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1", "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2", "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3", "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4", "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1", "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2", "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3", "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4", "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1", "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Tan", + HlslName = "tan", + Summary = "Returns the tangent of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value, in radians." } + }, + Returns = "The tangent of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Tanh", + HlslName = "tanh", + Summary = "Returns the hyperbolic tangent of the specified value.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified value, in radians." } + }, + Returns = "The hyperbolic tangent of the {x} parameter.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + }, + new + { + Name = "Transpose", + HlslName = "transpose", + Summary = "Transposes the specified input matrix.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified matrix." } + }, + Returns = "The transposed value of the {x} parameter.", + Overloads = new[] + { + new { Return = "Float2x1", Params = new[] { "Float1x2" } }, + new { Return = "Float3x1", Params = new[] { "Float1x3" } }, + new { Return = "Float4x1", Params = new[] { "Float1x4" } }, + new { Return = "Float1x2", Params = new[] { "Float2x1" } }, + new { Return = "Float3x2", Params = new[] { "Float2x3" } }, + new { Return = "Float4x2", Params = new[] { "Float2x4" } }, + new { Return = "Float1x3", Params = new[] { "Float3x1" } }, + new { Return = "Float2x3", Params = new[] { "Float3x2" } }, + new { Return = "Float4x3", Params = new[] { "Float3x4" } }, + new { Return = "Float1x4", Params = new[] { "Float4x1" } }, + new { Return = "Float2x4", Params = new[] { "Float4x2" } }, + new { Return = "Float3x4", Params = new[] { "Float4x3" } }, + new { Return = "Int2x1", Params = new[] { "Int1x2" } }, + new { Return = "Int3x1", Params = new[] { "Int1x3" } }, + new { Return = "Int4x1", Params = new[] { "Int1x4" } }, + new { Return = "Int1x2", Params = new[] { "Int2x1" } }, + new { Return = "Int3x2", Params = new[] { "Int2x3" } }, + new { Return = "Int4x2", Params = new[] { "Int2x4" } }, + new { Return = "Int1x3", Params = new[] { "Int3x1" } }, + new { Return = "Int2x3", Params = new[] { "Int3x2" } }, + new { Return = "Int4x3", Params = new[] { "Int3x4" } }, + new { Return = "Int1x4", Params = new[] { "Int4x1" } }, + new { Return = "Int2x4", Params = new[] { "Int4x2" } }, + new { Return = "Int3x4", Params = new[] { "Int4x3" } }, + new { Return = "Bool2x1", Params = new[] { "Bool1x2" } }, + new { Return = "Bool3x1", Params = new[] { "Bool1x3" } }, + new { Return = "Bool4x1", Params = new[] { "Bool1x4" } }, + new { Return = "Bool1x2", Params = new[] { "Bool2x1" } }, + new { Return = "Bool3x2", Params = new[] { "Bool2x3" } }, + new { Return = "Bool4x2", Params = new[] { "Bool2x4" } }, + new { Return = "Bool1x3", Params = new[] { "Bool3x1" } }, + new { Return = "Bool2x3", Params = new[] { "Bool3x2" } }, + new { Return = "Bool4x3", Params = new[] { "Bool3x4" } }, + new { Return = "Bool1x4", Params = new[] { "Bool4x1" } }, + new { Return = "Bool2x4", Params = new[] { "Bool4x2" } }, + new { Return = "Bool3x4", Params = new[] { "Bool4x3" } }, + }, + IsPure = true + }, + new + { + Name = "Trunc", + HlslName = "trunc", + Summary = "Truncates a floating-point value to the integer component.", + Parameters = new[] + { + new { IsOut = false, Name = "x", Info = "The specified input." } + }, + Returns = "The input value truncated to an integer component.", + Overloads = new[] + { + new { Return = "float", Params = new[] { "float" } }, + new { Return = "Float2", Params = new[] { "Float2" } }, + new { Return = "Float3", Params = new[] { "Float3" } }, + new { Return = "Float4", Params = new[] { "Float4" } }, + new { Return = "Float1x1", Params = new[] { "Float1x1" } }, + new { Return = "Float1x2", Params = new[] { "Float1x2" } }, + new { Return = "Float1x3", Params = new[] { "Float1x3" } }, + new { Return = "Float1x4", Params = new[] { "Float1x4" } }, + new { Return = "Float2x1", Params = new[] { "Float2x1" } }, + new { Return = "Float2x2", Params = new[] { "Float2x2" } }, + new { Return = "Float2x3", Params = new[] { "Float2x3" } }, + new { Return = "Float2x4", Params = new[] { "Float2x4" } }, + new { Return = "Float3x1", Params = new[] { "Float3x1" } }, + new { Return = "Float3x2", Params = new[] { "Float3x2" } }, + new { Return = "Float3x3", Params = new[] { "Float3x3" } }, + new { Return = "Float3x4", Params = new[] { "Float3x4" } }, + new { Return = "Float4x1", Params = new[] { "Float4x1" } }, + new { Return = "Float4x2", Params = new[] { "Float4x2" } }, + new { Return = "Float4x3", Params = new[] { "Float4x3" } }, + new { Return = "Float4x4", Params = new[] { "Float4x4" } } + }, + IsPure = true + } +}; +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/PixelTypes/Bgra32.cs b/src/ComputeSharp/Core/PixelTypes/Bgra32.cs new file mode 100644 index 00000000..3a9172d2 --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/Bgra32.cs @@ -0,0 +1,122 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. + /// The color components are stored in blue, green, red, and alpha order (least significant to most significant byte). + /// The format is binary compatible with System.Drawing.Imaging.PixelFormat.Format32bppArgb. + /// + /// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. + /// + /// + /// This struct is fully mutable. + [StructLayout(LayoutKind.Sequential)] + public struct Bgra32 : IEquatable, IUnorm, IUnorm + { + /// + /// The blue component. + /// + public byte B; + + /// + /// The green component. + /// + public byte G; + + /// + /// The red component. + /// + public byte R; + + /// + /// The alpha component. + /// + public byte A; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Bgra32(byte r, byte g, byte b) + { + R = r; + G = g; + B = b; + A = byte.MaxValue; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + /// The alpha component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Bgra32(byte r, byte g, byte b, byte a) + { + R = r; + G = g; + B = b; + A = a; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public uint PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Bgra32 left, Bgra32 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Bgra32 left, Bgra32 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Bgra32 other && Equals(other); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Bgra32 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})"; + } +} diff --git a/src/ComputeSharp/Core/PixelTypes/R16.cs b/src/ComputeSharp/Core/PixelTypes/R16.cs new file mode 100644 index 00000000..8e6a8951 --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/R16.cs @@ -0,0 +1,81 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// Packed pixel type containing a single 16-bit unsigned normalized channel value. + /// + /// Ranges from [0, 0, 0, 0] to [1, 0, 0, 0] in vector form. + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct R16 : IEquatable, IUnorm + { + /// + /// The red component. + /// + public ushort R; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + public R16(ushort r) + { + R = r; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public ushort PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(R16 left, R16 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(R16 left, R16 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is R16 R16 && Equals(R16); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(R16 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(R16)}({this.R})"; + } +} diff --git a/src/ComputeSharp/Core/PixelTypes/R8.cs b/src/ComputeSharp/Core/PixelTypes/R8.cs new file mode 100644 index 00000000..cb627b96 --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/R8.cs @@ -0,0 +1,81 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// Packed pixel type containing a single 8-bit unsigned normalized channel value. + /// + /// Ranges from [0, 0, 0, 0] to [1, 0, 0, 0] in vector form. + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct R8 : IEquatable, IUnorm + { + /// + /// The red component. + /// + public byte R; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + public R8(byte r) + { + R = r; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public byte PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(R8 left, R8 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(R8 left, R8 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is R8 R8 && Equals(R8); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(R8 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(R8)}({this.R})"; + } +} diff --git a/src/ComputeSharp/Core/PixelTypes/Rg16.cs b/src/ComputeSharp/Core/PixelTypes/Rg16.cs new file mode 100644 index 00000000..5da5ce6d --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/Rg16.cs @@ -0,0 +1,89 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// Packed pixel type containing two 8-bit unsigned normalized values ranging from 0 to 255. + /// + /// Ranges from [0, 0, 0, 0] to [1, 1, 0, 0] in vector form. + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct Rg16 : IEquatable, IUnorm, IUnorm + { + /// + /// The red component. + /// + public byte R; + + /// + /// The green component. + /// + public byte G; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + public Rg16(byte r, byte g) + { + R = r; + G = g; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public ushort PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rg16 left, Rg16 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rg16 left, Rg16 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rg16 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rg16 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rg16)}({this.R}, {this.G})"; + } +} diff --git a/src/ComputeSharp/Core/PixelTypes/Rg32.cs b/src/ComputeSharp/Core/PixelTypes/Rg32.cs new file mode 100644 index 00000000..8d0e39ba --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/Rg32.cs @@ -0,0 +1,89 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// Packed pixel type containing two 16-bit unsigned normalized values ranging from 0 to 255. + /// + /// Ranges from [0, 0, 0, 0] to [1, 1, 0, 0] in vector form. + /// + /// + [StructLayout(LayoutKind.Sequential)] + public struct Rg32 : IEquatable, IUnorm, IUnorm + { + /// + /// The red component. + /// + public ushort R; + + /// + /// The green component. + /// + public ushort G; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + public Rg32(ushort r, ushort g) + { + R = r; + G = g; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public uint PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rg32 left, Rg32 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rg32 left, Rg32 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rg32 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rg32 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rg32)}({this.R}, {this.G})"; + } +} diff --git a/src/ComputeSharp/Core/PixelTypes/Rgba32.cs b/src/ComputeSharp/Core/PixelTypes/Rgba32.cs new file mode 100644 index 00000000..7e21c856 --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/Rgba32.cs @@ -0,0 +1,121 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// Packed pixel type containing four 8-bit unsigned normalized values ranging from 0 to 255. + /// The color components are stored in red, green, blue, and alpha order (least significant to most significant byte). + /// + /// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. + /// + /// + /// This struct is fully mutable. + [StructLayout(LayoutKind.Sequential)] + public struct Rgba32 : IEquatable, IUnorm, IUnorm + { + /// + /// The red component. + /// + public byte R; + + /// + /// The green component. + /// + public byte G; + + /// + /// The blue component. + /// + public byte B; + + /// + /// The alpha component. + /// + public byte A; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba32(byte r, byte g, byte b) + { + this.R = r; + this.G = g; + this.B = b; + this.A = byte.MaxValue; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + /// The alpha component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba32(byte r, byte g, byte b, byte a) + { + this.R = r; + this.G = g; + this.B = b; + this.A = a; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public uint PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rgba32 left, Rgba32 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rgba32 left, Rgba32 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rgba32 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rgba32 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})"; + } +} diff --git a/src/ComputeSharp/Core/PixelTypes/Rgba64.cs b/src/ComputeSharp/Core/PixelTypes/Rgba64.cs new file mode 100644 index 00000000..7d1c7eb1 --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/Rgba64.cs @@ -0,0 +1,121 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// Packed pixel type containing four 16-bit unsigned normalized values ranging from 0 to 255. + /// The color components are stored in red, green, blue, and alpha order (least significant to most significant byte). + /// + /// Ranges from [0, 0, 0, 0] to [1, 1, 1, 1] in vector form. + /// + /// + /// This struct is fully mutable. + [StructLayout(LayoutKind.Sequential)] + public struct Rgba64 : IEquatable, IUnorm, IUnorm + { + /// + /// The red component. + /// + public ushort R; + + /// + /// The green component. + /// + public ushort G; + + /// + /// The blue component. + /// + public ushort B; + + /// + /// The alpha component. + /// + public ushort A; + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba64(ushort r, ushort g, ushort b) + { + this.R = r; + this.G = g; + this.B = b; + this.A = ushort.MaxValue; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The red component. + /// The green component. + /// The blue component. + /// The alpha component. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Rgba64(ushort r, ushort g, ushort b, ushort a) + { + this.R = r; + this.G = g; + this.B = b; + this.A = a; + } + + /// + /// Gets or sets the packed representation of the struct. + /// + public ulong PackedValue + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + readonly get => Unsafe.As(ref Unsafe.AsRef(this)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + set => Unsafe.As(ref this) = value; + } + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Rgba64 left, Rgba64 right) => left.Equals(right); + + /// + /// Compares two objects for equality. + /// + /// The on the left side of the operand. + /// The on the right side of the operand. + /// + /// True if the parameter is not equal to the parameter; otherwise, false. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Rgba64 left, Rgba64 right) => !left.Equals(right); + + /// + public override readonly bool Equals(object? obj) => obj is Rgba64 rgba32 && Equals(rgba32); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly bool Equals(Rgba64 other) => PackedValue.Equals(other.PackedValue); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override readonly int GetHashCode() => PackedValue.GetHashCode(); + + /// + public override readonly string ToString() => $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})"; + } +} diff --git a/src/ComputeSharp/Core/PixelTypes/__Internals/IUnorm{TPixel}.cs b/src/ComputeSharp/Core/PixelTypes/__Internals/IUnorm{TPixel}.cs new file mode 100644 index 00000000..4f138d99 --- /dev/null +++ b/src/ComputeSharp/Core/PixelTypes/__Internals/IUnorm{TPixel}.cs @@ -0,0 +1,16 @@ +using System; +using System.ComponentModel; + +namespace ComputeSharp.__Internals +{ + /// + /// Indicates the supported HLSL pixel types to represent a given normalized pixel type. + /// + /// The type of pixels used on the GPU side. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This interface is not intended to be used directly by user code")] + public interface IUnorm + where TPixel : unmanaged + { + } +} diff --git a/src/ComputeSharp.Core/Primitives/Bool/Bool.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool.cs similarity index 62% rename from src/ComputeSharp.Core/Primitives/Bool/Bool.cs rename to src/ComputeSharp/Core/Primitives/Bool/Bool.cs index 597d7695..8af16442 100644 --- a/src/ComputeSharp.Core/Primitives/Bool/Bool.cs +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool.cs @@ -4,63 +4,75 @@ using System.Runtime.InteropServices; namespace ComputeSharp { /// - /// A that can be used in place of the type in HLSL shaders + /// A that can be used in place of the type in HLSL shaders. /// [DebuggerDisplay("{Value}")] - [StructLayout(LayoutKind.Explicit, Size = sizeof(int))] + [StructLayout(LayoutKind.Explicit, Size = sizeof(int), Pack = 4)] public readonly struct Bool { /// - /// The wrapped value for the current instance + /// The wrapped value for the current instance. /// [FieldOffset(0)] private readonly bool Value; /// - /// Creates a new instance for a given value + /// Creates a new instance for a given value. /// - /// - private Bool(bool value) => Value = value; + /// . + private Bool(bool value) + { + Value = value; + } /// - public override bool Equals(object obj) => obj is Bool x && Value == x.Value; + public override bool Equals(object? obj) + { + return obj is Bool x && Value == x.Value; + } /// - public override int GetHashCode() => Value.GetHashCode(); + public override int GetHashCode() + { + return Value.GetHashCode(); + } /// - public override string ToString() => Value.ToString(); + public override string ToString() + { + return Value.ToString(); + } /// - /// Checks whether or not two instances represent the same value + /// Checks whether or not two instances represent the same value. /// - /// The left instance - /// The right instance + /// The left instance. + /// The right instance. public static bool operator ==(Bool left, Bool right) => left.Value == right.Value; /// - /// Checks whether or not two instances represent a different value + /// Checks whether or not two instances represent a different value. /// - /// The left instance - /// The right instance + /// The left instance. + /// The right instance. public static bool operator !=(Bool left, Bool right) => left.Value != right.Value; /// - /// Inverts the value represented by a given instance + /// Inverts the value represented by a given instance. /// - /// The input instance - public static Bool operator !(Bool x) => new Bool(!x.Value); + /// The input instance. + public static Bool operator !(Bool x) => new(!x.Value); /// - /// Converts a given instance to its corresponding value + /// Converts a given instance to its corresponding value. /// - /// The input instance + /// The input instance. public static implicit operator bool(Bool x) => x.Value; /// - /// Converts a value to a corresponding instance + /// Converts a value to a corresponding instance. /// - /// The input value - public static implicit operator Bool(bool x) => new Bool(x); + /// The input value. + public static implicit operator Bool(bool x) => new(x); } } diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs new file mode 100644 index 00000000..ad578a8a --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool2.cs @@ -0,0 +1,48 @@ +using System.Diagnostics; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y})")] + public partial struct Bool2 + { + /// + /// Gets an value with all components set to . + /// + public static Bool2 False => false; + + /// + /// Gets an value with all components set to . + /// + public static Bool2 True => true; + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool2 TrueX => new(true, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool2 TrueY => new(false, true); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + public Bool2(bool x, bool y) + { + this.x = x; + this.y = y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool2(bool x) => new(x, x); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs new file mode 100644 index 00000000..89c9426c --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool2.g.cs @@ -0,0 +1,222 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Bool2 + { + [FieldOffset(0)] + private bool x; + + [FieldOffset(4)] + private bool y; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref bool this[int i] => throw new InvalidExecutionContextException($"{nameof(Bool2)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref bool X => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref bool Y => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref bool Z => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref bool W => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 XX => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XY => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XZ => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XW => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YX => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 YY => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YZ => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YW => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZX => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZY => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 ZZ => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZW => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WX => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WY => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WZ => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 WW => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(WW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref bool R => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref bool G => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref bool B => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref bool A => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 RR => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RG => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RB => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RA => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GR => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 GG => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GB => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GA => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BR => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BG => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 BB => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BA => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AR => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AG => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AB => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 AA => throw new InvalidExecutionContextException($"{nameof(Bool2)}.{nameof(AA)}"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool2.tt b/src/ComputeSharp/Core/Primitives/Bool/Bool2.tt new file mode 100644 index 00000000..801f6c2b --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool2.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Bool2", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs new file mode 100644 index 00000000..c52d99d2 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool3.cs @@ -0,0 +1,79 @@ +using System.Diagnostics; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z})")] + public partial struct Bool3 + { + /// + /// Gets an value with all components set to . + /// + public static Bool3 False => false; + + /// + /// Gets an value with all components set to . + /// + public static Bool3 True => true; + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool3 TrueX => new(true, false, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool3 TrueY => new(false, true, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool3 TrueZ => new(false, false, true); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + public Bool3(bool x, bool y, bool z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Bool3(Bool2 xy, bool z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Bool3(bool x, Bool2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool3(bool x) => new(x, x, x); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs new file mode 100644 index 00000000..de0e57e9 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool3.g.cs @@ -0,0 +1,865 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Bool3 + { + [FieldOffset(0)] + private bool x; + + [FieldOffset(4)] + private bool y; + + [FieldOffset(8)] + private bool z; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref bool this[int i] => throw new InvalidExecutionContextException($"{nameof(Bool3)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref bool X => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref bool Y => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref bool Z => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref bool W => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 XX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 YY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 ZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 WW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XYX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XYY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XYZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XYW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XZX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XZY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XZW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XWX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XWY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XWZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XWW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YXX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YXY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YXZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YXW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YZX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YZY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YZW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YWX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YWY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YWZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YWW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZXX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZXY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZXW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZYX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZYY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZYW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZWX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZWY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZWW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WXX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WXY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WXZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WXW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WYX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WYY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WYZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WYW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WZX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WZY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WZZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WZW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWX => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWY => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWZ => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWW => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(WWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref bool R => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref bool G => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref bool B => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref bool A => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 RR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 GG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 BB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 AA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RGR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RGG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RGB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RGA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RBR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RBG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RBB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RBA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RAR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RAG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RAB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RAA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GRR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GRG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GRB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GRA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GBR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GBG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GBB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GBA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GAR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GAG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GAB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GAA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BRR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BRG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BRB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BRA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BGR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BGG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BGB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BGA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BAR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BAG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BAB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BAA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ARR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ARG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ARB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ARA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 AGR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AGG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 AGB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AGA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ABR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ABG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ABB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ABA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAR => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAG => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAB => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAA => throw new InvalidExecutionContextException($"{nameof(Bool3)}.{nameof(AAA)}"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool3.tt b/src/ComputeSharp/Core/Primitives/Bool/Bool3.tt new file mode 100644 index 00000000..6488af44 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool3.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Bool3", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs new file mode 100644 index 00000000..305cc760 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool4.cs @@ -0,0 +1,129 @@ +using System.Diagnostics; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] + public partial struct Bool4 + { + /// + /// Gets an value with all components set to . + /// + public static Bool4 False => false; + + /// + /// Gets an value with all components set to . + /// + public static Bool4 True => true; + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueX => new(true, false, false, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueY => new(false, true, false, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueZ => new(false, false, true, false); + + /// + /// Gets an value with the component set to , and the others to . + /// + public static Bool4 TrueW => new(false, false, false, true); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Bool4(bool x, bool y, bool z, bool w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Bool4(Bool2 xy, bool z, bool w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third and fourth vector components. + public Bool4(bool x, bool y, Bool2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Bool4(Bool2 xy, Bool2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Bool4(Bool3 xyz, bool w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Bool4(bool x, Bool3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool4(bool x) => new(x, x, x, x); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs b/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs new file mode 100644 index 00000000..fbd9fc50 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool4.g.cs @@ -0,0 +1,3428 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Bool4 + { + [FieldOffset(0)] + private bool x; + + [FieldOffset(4)] + private bool y; + + [FieldOffset(8)] + private bool z; + + [FieldOffset(12)] + private bool w; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref bool this[int i] => throw new InvalidExecutionContextException($"{nameof(Bool4)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref bool X => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref bool Y => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref bool Z => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref bool W => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 XX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 XW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 YY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 YW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 ZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 ZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 WZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 WW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 XWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 XWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 YWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 YWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 WZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 WWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 XYZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 XYWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 XZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 XZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 XWYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 XWZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 XWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(XWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 YXZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 YXWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 YZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 YZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 YWXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 YWZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 YWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(YWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ZXYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ZXWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ZYXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ZYWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ZWXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ZWYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ZWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 WXYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 WXZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WXWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 WYXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 WYZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WYWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 WZXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 WZYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WZWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWXX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWXY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWXW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWYX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWYY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWYW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWZX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWZY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWZW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWWX => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWWY => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 WWWW => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(WWWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref bool R => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref bool G => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref bool B => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref bool A => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 RR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 RA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 GG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 GA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 BB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 BA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Bool2 AB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Bool2 AA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 RAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 RAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 GAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 GAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 BAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 BAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 AGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 AGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Bool3 ABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 ABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Bool3 AAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RRAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 RGBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 RGAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 RBGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 RBAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RBAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RAGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 RAGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 RABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 RAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(RAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 GRBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 GRAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GRAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 GBRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 GBAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GBAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 GARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 GABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 GAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(GAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 BRGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 BRAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BRAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 BGRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 BGAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BBAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 BARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BARA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 BAGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BAGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 BAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(BAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ARGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ARBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ARAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ARAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 AGRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 AGBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AGAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABRR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ABRG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABRB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABRA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABRA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Bool4 ABGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABBR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABBG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABBB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABBA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 ABAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(ABAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AARR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AARG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AARB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AARA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAGR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAGG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAGB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAGA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AABR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AABG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AABB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AABA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAAR => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAAG => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAAB => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Bool4 AAAA => throw new InvalidExecutionContextException($"{nameof(Bool4)}.{nameof(AAAA)}"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Bool/Bool4.tt b/src/ComputeSharp/Core/Primitives/Bool/Bool4.tt new file mode 100644 index 00000000..0d039431 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/Bool4.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Bool4", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs new file mode 100644 index 00000000..35fa4cd2 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.g.cs @@ -0,0 +1,2720 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] + public partial struct Bool1x1 + { + [FieldOffset(0)] + private bool m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Bool1x1(bool m11) + { + this.m11 = m11; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref bool this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool1x1)}.M11"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool1x1(bool x) + { + Bool1x1 matrix; + + matrix.m11 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool1x1 operator -(Bool1x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool1x1 operator +(Bool1x1 left, Bool1x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool1x1 operator /(Bool1x1 left, Bool1x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool1x1 operator *(Bool1x1 left, Bool1x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool1x1 operator -(Bool1x1 left, Bool1x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x1)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Bool1x2 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Bool1x2(bool m11, bool m12) + { + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool1x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool1x2)}.M12"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool1x2(bool x) + { + Bool1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool1x2 operator -(Bool1x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool1x2 operator +(Bool1x2 left, Bool1x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool1x2 operator /(Bool1x2 left, Bool1x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool1x2 operator *(Bool1x2 left, Bool1x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool1x2 operator -(Bool1x2 left, Bool1x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x2)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool1x2(Bool2 vector) => throw new InvalidExecutionContextException($"{typeof(Bool1x2)}.{nameof(Bool1x2)}({nameof(Bool2)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Bool1x3 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Bool1x3(bool m11, bool m12, bool m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool1x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool1x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool1x3)}.M13"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool1x3(bool x) + { + Bool1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool1x3 operator -(Bool1x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool1x3 operator +(Bool1x3 left, Bool1x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool1x3 operator /(Bool1x3 left, Bool1x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool1x3 operator *(Bool1x3 left, Bool1x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool1x3 operator -(Bool1x3 left, Bool1x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x3)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool1x3(Bool3 vector) => throw new InvalidExecutionContextException($"{typeof(Bool1x3)}.{nameof(Bool1x3)}({nameof(Bool3)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Bool1x4 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Bool1x4(bool m11, bool m12, bool m13, bool m14) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool1x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool1x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool1x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref bool M14 => throw new InvalidExecutionContextException($"{typeof(Bool1x4)}.M14"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool1x4(bool x) + { + Bool1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool1x4 operator -(Bool1x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool1x4 operator +(Bool1x4 left, Bool1x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool1x4 operator /(Bool1x4 left, Bool1x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool1x4 operator *(Bool1x4 left, Bool1x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool1x4 operator -(Bool1x4 left, Bool1x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool1x4)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool1x4(Bool4 vector) => throw new InvalidExecutionContextException($"{typeof(Bool1x4)}.{nameof(Bool1x4)}({nameof(Bool4)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Bool2x1 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Bool2x1(bool m11, bool m21) + { + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref bool this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool2x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool2x1)}.M21"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool2x1(bool x) + { + Bool2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool2x1 operator -(Bool2x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool2x1 operator +(Bool2x1 left, Bool2x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool2x1 operator /(Bool2x1 left, Bool2x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool2x1 operator *(Bool2x1 left, Bool2x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool2x1 operator -(Bool2x1 left, Bool2x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool2(Bool2x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Bool2x1)}.{nameof(Bool2)}({nameof(Bool2x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Bool2x2 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m21; + + [FieldOffset(12)] + private bool m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Bool2x2(bool m11, bool m12, bool m21, bool m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Bool2x2(Bool2 row1, Bool2 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool2x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool2x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool2x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool2x2)}.M22"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool2x2(bool x) + { + Bool2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool2x2 operator -(Bool2x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool2x2 operator +(Bool2x2 left, Bool2x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool2x2 operator /(Bool2x2 left, Bool2x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool2x2 operator *(Bool2x2 left, Bool2x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool2x2 operator -(Bool2x2 left, Bool2x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct Bool2x3 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m21; + + [FieldOffset(16)] + private bool m22; + + [FieldOffset(20)] + private bool m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Bool2x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Bool2x3(Bool3 row1, Bool3 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool2x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool2x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool2x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool2x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool2x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref bool M23 => throw new InvalidExecutionContextException($"{typeof(Bool2x3)}.M23"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool2x3(bool x) + { + Bool2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool2x3 operator -(Bool2x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool2x3 operator +(Bool2x3 left, Bool2x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool2x3 operator /(Bool2x3 left, Bool2x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool2x3 operator *(Bool2x3 left, Bool2x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool2x3 operator -(Bool2x3 left, Bool2x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct Bool2x4 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + [FieldOffset(16)] + private bool m21; + + [FieldOffset(20)] + private bool m22; + + [FieldOffset(24)] + private bool m23; + + [FieldOffset(28)] + private bool m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Bool2x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Bool2x4(Bool4 row1, Bool4 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref bool M14 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref bool M23 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref bool M24 => throw new InvalidExecutionContextException($"{typeof(Bool2x4)}.M24"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool2x4(bool x) + { + Bool2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool2x4 operator -(Bool2x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool2x4 operator +(Bool2x4 left, Bool2x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool2x4 operator /(Bool2x4 left, Bool2x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool2x4 operator *(Bool2x4 left, Bool2x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool2x4 operator -(Bool2x4 left, Bool2x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool2x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Bool3x1 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m21; + + [FieldOffset(8)] + private bool m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Bool3x1(bool m11, bool m21, bool m31) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref bool this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool3x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool3x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool3x1)}.M31"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool3x1(bool x) + { + Bool3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool3x1 operator -(Bool3x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool3x1 operator +(Bool3x1 left, Bool3x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool3x1 operator /(Bool3x1 left, Bool3x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool3x1 operator *(Bool3x1 left, Bool3x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool3x1 operator -(Bool3x1 left, Bool3x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool3(Bool3x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Bool3x1)}.{nameof(Bool3)}({nameof(Bool3x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct Bool3x2 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m21; + + [FieldOffset(12)] + private bool m22; + + [FieldOffset(16)] + private bool m31; + + [FieldOffset(20)] + private bool m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Bool3x2(bool m11, bool m12, bool m21, bool m22, bool m31, bool m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Bool3x2(Bool2 row1, Bool2 row2, Bool2 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool3x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool3x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool3x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool3x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool3x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref bool M32 => throw new InvalidExecutionContextException($"{typeof(Bool3x2)}.M32"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool3x2(bool x) + { + Bool3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool3x2 operator -(Bool3x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool3x2 operator +(Bool3x2 left, Bool3x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool3x2 operator /(Bool3x2 left, Bool3x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool3x2 operator *(Bool3x2 left, Bool3x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool3x2 operator -(Bool3x2 left, Bool3x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] + public partial struct Bool3x3 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m21; + + [FieldOffset(16)] + private bool m22; + + [FieldOffset(20)] + private bool m23; + + [FieldOffset(24)] + private bool m31; + + [FieldOffset(28)] + private bool m32; + + [FieldOffset(32)] + private bool m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Bool3x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23, bool m31, bool m32, bool m33) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Bool3x3(Bool3 row1, Bool3 row2, Bool3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref bool M23 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref bool M32 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref bool M33 => throw new InvalidExecutionContextException($"{typeof(Bool3x3)}.M33"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool3x3(bool x) + { + Bool3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool3x3 operator -(Bool3x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool3x3 operator +(Bool3x3 left, Bool3x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool3x3 operator /(Bool3x3 left, Bool3x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool3x3 operator *(Bool3x3 left, Bool3x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool3x3 operator -(Bool3x3 left, Bool3x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct Bool3x4 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + [FieldOffset(16)] + private bool m21; + + [FieldOffset(20)] + private bool m22; + + [FieldOffset(24)] + private bool m23; + + [FieldOffset(28)] + private bool m24; + + [FieldOffset(32)] + private bool m31; + + [FieldOffset(36)] + private bool m32; + + [FieldOffset(40)] + private bool m33; + + [FieldOffset(44)] + private bool m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Bool3x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24, bool m31, bool m32, bool m33, bool m34) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Bool3x4(Bool4 row1, Bool4 row2, Bool4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref bool M14 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref bool M23 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref bool M24 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref bool M32 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref bool M33 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref bool M34 => throw new InvalidExecutionContextException($"{typeof(Bool3x4)}.M34"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool3x4(bool x) + { + Bool3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool3x4 operator -(Bool3x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool3x4 operator +(Bool3x4 left, Bool3x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool3x4 operator /(Bool3x4 left, Bool3x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool3x4 operator *(Bool3x4 left, Bool3x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool3x4 operator -(Bool3x4 left, Bool3x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool3x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Bool4x1 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m21; + + [FieldOffset(8)] + private bool m31; + + [FieldOffset(12)] + private bool m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Bool4x1(bool m11, bool m21, bool m31, bool m41) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref bool this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool4x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool4x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool4x1)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref bool M41 => throw new InvalidExecutionContextException($"{typeof(Bool4x1)}.M41"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool4x1(bool x) + { + Bool4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool4x1 operator -(Bool4x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool4x1 operator +(Bool4x1 left, Bool4x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool4x1 operator /(Bool4x1 left, Bool4x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool4x1 operator *(Bool4x1 left, Bool4x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool4x1 operator -(Bool4x1 left, Bool4x1 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Bool4(Bool4x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Bool4x1)}.{nameof(Bool4)}({nameof(Bool4x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct Bool4x2 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m21; + + [FieldOffset(12)] + private bool m22; + + [FieldOffset(16)] + private bool m31; + + [FieldOffset(20)] + private bool m32; + + [FieldOffset(24)] + private bool m41; + + [FieldOffset(28)] + private bool m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Bool4x2(bool m11, bool m12, bool m21, bool m22, bool m31, bool m32, bool m41, bool m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Bool4x2(Bool2 row1, Bool2 row2, Bool2 row3, Bool2 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref bool M32 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref bool M41 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref bool M42 => throw new InvalidExecutionContextException($"{typeof(Bool4x2)}.M42"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool4x2(bool x) + { + Bool4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool4x2 operator -(Bool4x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool4x2 operator +(Bool4x2 left, Bool4x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool4x2 operator /(Bool4x2 left, Bool4x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool4x2 operator *(Bool4x2 left, Bool4x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool4x2 operator -(Bool4x2 left, Bool4x2 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct Bool4x3 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m21; + + [FieldOffset(16)] + private bool m22; + + [FieldOffset(20)] + private bool m23; + + [FieldOffset(24)] + private bool m31; + + [FieldOffset(28)] + private bool m32; + + [FieldOffset(32)] + private bool m33; + + [FieldOffset(36)] + private bool m41; + + [FieldOffset(40)] + private bool m42; + + [FieldOffset(44)] + private bool m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Bool4x3(bool m11, bool m12, bool m13, bool m21, bool m22, bool m23, bool m31, bool m32, bool m33, bool m41, bool m42, bool m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Bool4x3(Bool3 row1, Bool3 row2, Bool3 row3, Bool3 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref bool M23 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref bool M32 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref bool M33 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref bool M41 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref bool M42 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref bool M43 => throw new InvalidExecutionContextException($"{typeof(Bool4x3)}.M43"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool4x3(bool x) + { + Bool4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool4x3 operator -(Bool4x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool4x3 operator +(Bool4x3 left, Bool4x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool4x3 operator /(Bool4x3 left, Bool4x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool4x3 operator *(Bool4x3 left, Bool4x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool4x3 operator -(Bool4x3 left, Bool4x3 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] + public partial struct Bool4x4 + { + [FieldOffset(0)] + private bool m11; + + [FieldOffset(4)] + private bool m12; + + [FieldOffset(8)] + private bool m13; + + [FieldOffset(12)] + private bool m14; + + [FieldOffset(16)] + private bool m21; + + [FieldOffset(20)] + private bool m22; + + [FieldOffset(24)] + private bool m23; + + [FieldOffset(28)] + private bool m24; + + [FieldOffset(32)] + private bool m31; + + [FieldOffset(36)] + private bool m32; + + [FieldOffset(40)] + private bool m33; + + [FieldOffset(44)] + private bool m34; + + [FieldOffset(48)] + private bool m41; + + [FieldOffset(52)] + private bool m42; + + [FieldOffset(56)] + private bool m43; + + [FieldOffset(60)] + private bool m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Bool4x4(bool m11, bool m12, bool m13, bool m14, bool m21, bool m22, bool m23, bool m24, bool m31, bool m32, bool m33, bool m34, bool m41, bool m42, bool m43, bool m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Bool4x4(Bool4 row1, Bool4 row2, Bool4 row3, Bool4 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Bool4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Bool2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Bool3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Bool4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref bool M11 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref bool M12 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref bool M13 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref bool M14 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref bool M21 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref bool M22 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref bool M23 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref bool M24 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref bool M31 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref bool M32 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref bool M33 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref bool M34 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M34"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref bool M41 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref bool M42 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref bool M43 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M43"); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public ref bool M44 => throw new InvalidExecutionContextException($"{typeof(Bool4x4)}.M44"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Bool4x4(bool x) + { + Bool4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Bool4x4 operator -(Bool4x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Bool4x4 operator +(Bool4x4 left, Bool4x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Bool4x4 operator /(Bool4x4 left, Bool4x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Bool4x4 operator *(Bool4x4 left, Bool4x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Bool4x4 operator -(Bool4x4 left, Bool4x4 right) => throw new InvalidExecutionContextException($"{nameof(Bool4x4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.tt b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.tt new file mode 100644 index 00000000..76a0d8bc --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Bool/BoolMxN.tt @@ -0,0 +1,4 @@ +<#@include file="..\MatrixType.ttinclude" #> +<# +GenerateAllMatrixProperties("Bool", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.cs b/src/ComputeSharp/Core/Primitives/Double/Double2.cs new file mode 100644 index 00000000..b28fa948 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double2.cs @@ -0,0 +1,67 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y})")] + public partial struct Double2 + { + /// + /// Gets an value with all components set to 0. + /// + public static Double2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Double2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double2 UnitY => new(0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + public Double2(double x, double y) + { + this.x = x; + this.y = y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double2(double x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int2(Double2 xy) => throw new InvalidExecutionContextException($"{nameof(Double2)}.({nameof(Int2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt2(Double2 xy) => throw new InvalidExecutionContextException($"{nameof(Double2)}.({nameof(UInt2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Float2(Double2 xy) => throw new InvalidExecutionContextException($"{nameof(Double2)}.({nameof(Float2)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs b/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs new file mode 100644 index 00000000..2476990a --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double2.g.cs @@ -0,0 +1,256 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] + public partial struct Double2 + { + [FieldOffset(0)] + private double x; + + [FieldOffset(8)] + private double y; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref double this[int i] => throw new InvalidExecutionContextException($"{nameof(Double2)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref double X => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref double Y => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref double Z => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref double W => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 XX => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XY => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XZ => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XW => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YX => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 YY => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YZ => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YW => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZX => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZY => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 ZZ => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZW => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WX => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WY => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WZ => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 WW => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(WW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref double R => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref double G => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref double B => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref double A => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 RR => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RG => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RB => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RA => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GR => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 GG => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GB => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GA => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BR => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BG => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 BB => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BA => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AR => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AG => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AB => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 AA => throw new InvalidExecutionContextException($"{nameof(Double2)}.{nameof(AA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double2 operator -(Double2 xy) => throw new InvalidExecutionContextException($"{nameof(Double2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double2 operator +(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Double2 operator /(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double2 operator *(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double2 operator -(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{nameof(Double2)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Double/Double2.tt b/src/ComputeSharp/Core/Primitives/Double/Double2.tt new file mode 100644 index 00000000..bf4dba72 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double2.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Double2", sizeof(double)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.cs b/src/ComputeSharp/Core/Primitives/Double/Double3.cs new file mode 100644 index 00000000..22ac229f --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double3.cs @@ -0,0 +1,98 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z})")] + public partial struct Double3 + { + /// + /// Gets an value with all components set to 0. + /// + public static Double3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Double3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double3 UnitZ => new(0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + public Double3(double x, double y, double z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Double3(Double2 xy, double z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Double3(double x, Double2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double3(double x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int3(Double3 xyz) => throw new InvalidExecutionContextException($"{nameof(Double3)}.({nameof(Int3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt3(Double3 xyz) => throw new InvalidExecutionContextException($"{nameof(Double3)}.({nameof(UInt3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Float3(Double3 xyz) => throw new InvalidExecutionContextException($"{nameof(Double3)}.({nameof(Float3)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs b/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs new file mode 100644 index 00000000..b0715bc5 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double3.g.cs @@ -0,0 +1,899 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] + public partial struct Double3 + { + [FieldOffset(0)] + private double x; + + [FieldOffset(8)] + private double y; + + [FieldOffset(16)] + private double z; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref double this[int i] => throw new InvalidExecutionContextException($"{nameof(Double3)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref double X => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref double Y => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref double Z => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref double W => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 XX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 YY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 ZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 WW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XYX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XYY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XYZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XYW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XZX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XZY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XZW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XWX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XWY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XWZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XWW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YXX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YXY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YXZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YXW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YZX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YZY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YZW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YWX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YWY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YWZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YWW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZXX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZXY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZXW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZYX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZYY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZYW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZWX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZWY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZWW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WXX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WXY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WXZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WXW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WYX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WYY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WYZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WYW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WZX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WZY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WZZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WZW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWX => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWY => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWZ => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWW => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(WWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref double R => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref double G => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref double B => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref double A => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 RR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 GG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 BB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 AA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RGR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RGG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RGB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RGA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RBR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RBG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RBB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RBA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RAR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RAG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RAB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RAA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GRR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GRG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GRB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GRA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GBR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GBG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GBB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GBA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GAR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GAG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GAB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GAA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BRR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BRG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BRB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BRA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BGR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BGG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BGB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BGA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BAR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BAG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BAB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BAA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ARR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ARG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ARB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ARA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 AGR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AGG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 AGB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AGA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ABR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ABG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ABB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ABA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAR => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAG => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAB => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAA => throw new InvalidExecutionContextException($"{nameof(Double3)}.{nameof(AAA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double3 operator -(Double3 xyz) => throw new InvalidExecutionContextException($"{nameof(Double3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double3 operator +(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Double3 operator /(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double3 operator *(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double3 operator -(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{nameof(Double3)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Double/Double3.tt b/src/ComputeSharp/Core/Primitives/Double/Double3.tt new file mode 100644 index 00000000..5f03bf2e --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double3.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Double3", sizeof(double)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.cs b/src/ComputeSharp/Core/Primitives/Double/Double4.cs new file mode 100644 index 00000000..76fc888c --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double4.cs @@ -0,0 +1,148 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] + public partial struct Double4 + { + /// + /// Gets an value with all components set to 0. + /// + public static Double4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Double4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Double4 UnitW => new(0, 0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Double4(double x, double y, double z, double w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Double4(Double2 xy, double z, double w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third and fourth vector components. + public Double4(double x, double y, Double2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Double4(Double2 xy, Double2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Double4(Double3 xyz, double w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Double4(double x, Double3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double4(double x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int4(Double4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Double4)}.({nameof(Int4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt4(Double4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Double4)}.({nameof(UInt4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Float4(Double4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Double4)}.({nameof(Float4)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs b/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs new file mode 100644 index 00000000..7b1fc1ca --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double4.g.cs @@ -0,0 +1,3462 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] + public partial struct Double4 + { + [FieldOffset(0)] + private double x; + + [FieldOffset(8)] + private double y; + + [FieldOffset(16)] + private double z; + + [FieldOffset(24)] + private double w; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref double this[int i] => throw new InvalidExecutionContextException($"{nameof(Double4)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref double X => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref double Y => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref double Z => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref double W => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 XX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 XW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 YY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 YW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 ZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 ZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 WZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 WW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 XWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 XWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 YWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 YWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 WZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 WWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 XYZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 XYWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 XZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 XZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 XWYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 XWZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 XWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(XWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 YXZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 YXWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 YZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 YZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 YWXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 YWZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 YWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(YWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ZXYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ZXWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ZYXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ZYWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ZWXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ZWYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ZWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 WXYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 WXZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WXWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 WYXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 WYZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WYWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 WZXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 WZYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WZWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWXX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWXY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWXW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWYX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWYY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWYW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWZX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWZY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWZW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWWX => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWWY => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 WWWW => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(WWWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref double R => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref double G => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref double B => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref double A => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 RR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 RA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 GG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 GA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 BB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 BA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Double2 AB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Double2 AA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 RAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 RAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 GAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 GAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 BAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 BAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 AGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 AGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Double3 ABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 ABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Double3 AAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RRAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 RGBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 RGAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 RBGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 RBAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RBAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RAGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 RAGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 RABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 RAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(RAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 GRBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 GRAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GRAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 GBRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 GBAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GBAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 GARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 GABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 GAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(GAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 BRGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 BRAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BRAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 BGRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 BGAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BBAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 BARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BARA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 BAGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BAGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 BAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(BAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ARGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ARBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ARAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ARAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 AGRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 AGBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AGAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABRR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ABRG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABRB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABRA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABRA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Double4 ABGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABBR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABBG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABBB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABBA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 ABAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(ABAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AARR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AARG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AARB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AARA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAGR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAGG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAGB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAGA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AABR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AABG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AABB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AABA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAAR => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAAG => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAAB => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Double4 AAAA => throw new InvalidExecutionContextException($"{nameof(Double4)}.{nameof(AAAA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double4 operator -(Double4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Double4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double4 operator +(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Double4 operator /(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double4 operator *(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double4 operator -(Double4 left, Double4 right) => throw new InvalidExecutionContextException($"{nameof(Double4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Double/Double4.tt b/src/ComputeSharp/Core/Primitives/Double/Double4.tt new file mode 100644 index 00000000..f953afbc --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/Double4.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Double4", sizeof(double)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs b/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs new file mode 100644 index 00000000..2e7f926e --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.g.cs @@ -0,0 +1,2720 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 8)] + public partial struct Double1x1 + { + [FieldOffset(0)] + private double m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Double1x1(double m11) + { + this.m11 = m11; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref double this[int row] => throw new InvalidExecutionContextException($"{nameof(Double1x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double1x1)}.M11"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double1x1(double x) + { + Double1x1 matrix; + + matrix.m11 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double1x1 operator -(Double1x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Double1x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double1x1 operator +(Double1x1 left, Double1x1 right) => throw new InvalidExecutionContextException($"{nameof(Double1x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double1x1 operator /(Double1x1 left, Double1x1 right) => throw new InvalidExecutionContextException($"{nameof(Double1x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double1x1 operator *(Double1x1 left, Double1x1 right) => throw new InvalidExecutionContextException($"{nameof(Double1x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double1x1 operator -(Double1x1 left, Double1x1 right) => throw new InvalidExecutionContextException($"{nameof(Double1x1)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] + public partial struct Double1x2 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Double1x2(double m11, double m12) + { + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double1x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double1x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double1x2)}.M12"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double1x2(double x) + { + Double1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double1x2 operator -(Double1x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Double1x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double1x2 operator +(Double1x2 left, Double1x2 right) => throw new InvalidExecutionContextException($"{nameof(Double1x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double1x2 operator /(Double1x2 left, Double1x2 right) => throw new InvalidExecutionContextException($"{nameof(Double1x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double1x2 operator *(Double1x2 left, Double1x2 right) => throw new InvalidExecutionContextException($"{nameof(Double1x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double1x2 operator -(Double1x2 left, Double1x2 right) => throw new InvalidExecutionContextException($"{nameof(Double1x2)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double1x2(Double2 vector) => throw new InvalidExecutionContextException($"{typeof(Double1x2)}.{nameof(Double1x2)}({nameof(Double2)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] + public partial struct Double1x3 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Double1x3(double m11, double m12, double m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double1x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double1x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double1x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double1x3)}.M13"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double1x3(double x) + { + Double1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double1x3 operator -(Double1x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Double1x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double1x3 operator +(Double1x3 left, Double1x3 right) => throw new InvalidExecutionContextException($"{nameof(Double1x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double1x3 operator /(Double1x3 left, Double1x3 right) => throw new InvalidExecutionContextException($"{nameof(Double1x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double1x3 operator *(Double1x3 left, Double1x3 right) => throw new InvalidExecutionContextException($"{nameof(Double1x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double1x3 operator -(Double1x3 left, Double1x3 right) => throw new InvalidExecutionContextException($"{nameof(Double1x3)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double1x3(Double3 vector) => throw new InvalidExecutionContextException($"{typeof(Double1x3)}.{nameof(Double1x3)}({nameof(Double3)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] + public partial struct Double1x4 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Double1x4(double m11, double m12, double m13, double m14) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double1x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double1x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double1x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double1x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref double M14 => throw new InvalidExecutionContextException($"{typeof(Double1x4)}.M14"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double1x4(double x) + { + Double1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double1x4 operator -(Double1x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Double1x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double1x4 operator +(Double1x4 left, Double1x4 right) => throw new InvalidExecutionContextException($"{nameof(Double1x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double1x4 operator /(Double1x4 left, Double1x4 right) => throw new InvalidExecutionContextException($"{nameof(Double1x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double1x4 operator *(Double1x4 left, Double1x4 right) => throw new InvalidExecutionContextException($"{nameof(Double1x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double1x4 operator -(Double1x4 left, Double1x4 right) => throw new InvalidExecutionContextException($"{nameof(Double1x4)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double1x4(Double4 vector) => throw new InvalidExecutionContextException($"{typeof(Double1x4)}.{nameof(Double1x4)}({nameof(Double4)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)] + public partial struct Double2x1 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Double2x1(double m11, double m21) + { + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref double this[int row] => throw new InvalidExecutionContextException($"{nameof(Double2x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double2x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double2x1)}.M21"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double2x1(double x) + { + Double2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double2x1 operator -(Double2x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Double2x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double2x1 operator +(Double2x1 left, Double2x1 right) => throw new InvalidExecutionContextException($"{nameof(Double2x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double2x1 operator /(Double2x1 left, Double2x1 right) => throw new InvalidExecutionContextException($"{nameof(Double2x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double2x1 operator *(Double2x1 left, Double2x1 right) => throw new InvalidExecutionContextException($"{nameof(Double2x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double2x1 operator -(Double2x1 left, Double2x1 right) => throw new InvalidExecutionContextException($"{nameof(Double2x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double2(Double2x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Double2x1)}.{nameof(Double2)}({nameof(Double2x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] + public partial struct Double2x2 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m21; + + [FieldOffset(24)] + private double m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Double2x2(double m11, double m12, double m21, double m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Double2x2(Double2 row1, Double2 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double2x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double2x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double2x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double2x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double2x2)}.M22"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double2x2(double x) + { + Double2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double2x2 operator -(Double2x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Double2x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double2x2 operator +(Double2x2 left, Double2x2 right) => throw new InvalidExecutionContextException($"{nameof(Double2x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double2x2 operator /(Double2x2 left, Double2x2 right) => throw new InvalidExecutionContextException($"{nameof(Double2x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double2x2 operator *(Double2x2 left, Double2x2 right) => throw new InvalidExecutionContextException($"{nameof(Double2x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double2x2 operator -(Double2x2 left, Double2x2 right) => throw new InvalidExecutionContextException($"{nameof(Double2x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)] + public partial struct Double2x3 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m21; + + [FieldOffset(32)] + private double m22; + + [FieldOffset(40)] + private double m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Double2x3(double m11, double m12, double m13, double m21, double m22, double m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Double2x3(Double3 row1, Double3 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double2x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double2x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double2x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double2x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double2x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double2x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref double M23 => throw new InvalidExecutionContextException($"{typeof(Double2x3)}.M23"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double2x3(double x) + { + Double2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double2x3 operator -(Double2x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Double2x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double2x3 operator +(Double2x3 left, Double2x3 right) => throw new InvalidExecutionContextException($"{nameof(Double2x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double2x3 operator /(Double2x3 left, Double2x3 right) => throw new InvalidExecutionContextException($"{nameof(Double2x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double2x3 operator *(Double2x3 left, Double2x3 right) => throw new InvalidExecutionContextException($"{nameof(Double2x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double2x3 operator -(Double2x3 left, Double2x3 right) => throw new InvalidExecutionContextException($"{nameof(Double2x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)] + public partial struct Double2x4 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + [FieldOffset(32)] + private double m21; + + [FieldOffset(40)] + private double m22; + + [FieldOffset(48)] + private double m23; + + [FieldOffset(56)] + private double m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Double2x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Double2x4(Double4 row1, Double4 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double2x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref double M14 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref double M23 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref double M24 => throw new InvalidExecutionContextException($"{typeof(Double2x4)}.M24"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double2x4(double x) + { + Double2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double2x4 operator -(Double2x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Double2x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double2x4 operator +(Double2x4 left, Double2x4 right) => throw new InvalidExecutionContextException($"{nameof(Double2x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double2x4 operator /(Double2x4 left, Double2x4 right) => throw new InvalidExecutionContextException($"{nameof(Double2x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double2x4 operator *(Double2x4 left, Double2x4 right) => throw new InvalidExecutionContextException($"{nameof(Double2x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double2x4 operator -(Double2x4 left, Double2x4 right) => throw new InvalidExecutionContextException($"{nameof(Double2x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)] + public partial struct Double3x1 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m21; + + [FieldOffset(16)] + private double m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Double3x1(double m11, double m21, double m31) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref double this[int row] => throw new InvalidExecutionContextException($"{nameof(Double3x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double3x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double3x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double3x1)}.M31"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double3x1(double x) + { + Double3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double3x1 operator -(Double3x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Double3x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double3x1 operator +(Double3x1 left, Double3x1 right) => throw new InvalidExecutionContextException($"{nameof(Double3x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double3x1 operator /(Double3x1 left, Double3x1 right) => throw new InvalidExecutionContextException($"{nameof(Double3x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double3x1 operator *(Double3x1 left, Double3x1 right) => throw new InvalidExecutionContextException($"{nameof(Double3x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double3x1 operator -(Double3x1 left, Double3x1 right) => throw new InvalidExecutionContextException($"{nameof(Double3x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double3(Double3x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Double3x1)}.{nameof(Double3)}({nameof(Double3x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 8)] + public partial struct Double3x2 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m21; + + [FieldOffset(24)] + private double m22; + + [FieldOffset(32)] + private double m31; + + [FieldOffset(40)] + private double m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Double3x2(double m11, double m12, double m21, double m22, double m31, double m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Double3x2(Double2 row1, Double2 row2, Double2 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double3x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double3x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double3x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double3x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double3x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double3x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref double M32 => throw new InvalidExecutionContextException($"{typeof(Double3x2)}.M32"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double3x2(double x) + { + Double3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double3x2 operator -(Double3x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Double3x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double3x2 operator +(Double3x2 left, Double3x2 right) => throw new InvalidExecutionContextException($"{nameof(Double3x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double3x2 operator /(Double3x2 left, Double3x2 right) => throw new InvalidExecutionContextException($"{nameof(Double3x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double3x2 operator *(Double3x2 left, Double3x2 right) => throw new InvalidExecutionContextException($"{nameof(Double3x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double3x2 operator -(Double3x2 left, Double3x2 right) => throw new InvalidExecutionContextException($"{nameof(Double3x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 72, Pack = 8)] + public partial struct Double3x3 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m21; + + [FieldOffset(32)] + private double m22; + + [FieldOffset(40)] + private double m23; + + [FieldOffset(48)] + private double m31; + + [FieldOffset(56)] + private double m32; + + [FieldOffset(64)] + private double m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Double3x3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Double3x3(Double3 row1, Double3 row2, Double3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double3x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref double M23 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref double M32 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref double M33 => throw new InvalidExecutionContextException($"{typeof(Double3x3)}.M33"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double3x3(double x) + { + Double3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double3x3 operator -(Double3x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Double3x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double3x3 operator +(Double3x3 left, Double3x3 right) => throw new InvalidExecutionContextException($"{nameof(Double3x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double3x3 operator /(Double3x3 left, Double3x3 right) => throw new InvalidExecutionContextException($"{nameof(Double3x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double3x3 operator *(Double3x3 left, Double3x3 right) => throw new InvalidExecutionContextException($"{nameof(Double3x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double3x3 operator -(Double3x3 left, Double3x3 right) => throw new InvalidExecutionContextException($"{nameof(Double3x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)] + public partial struct Double3x4 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + [FieldOffset(32)] + private double m21; + + [FieldOffset(40)] + private double m22; + + [FieldOffset(48)] + private double m23; + + [FieldOffset(56)] + private double m24; + + [FieldOffset(64)] + private double m31; + + [FieldOffset(72)] + private double m32; + + [FieldOffset(80)] + private double m33; + + [FieldOffset(88)] + private double m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Double3x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Double3x4(Double4 row1, Double4 row2, Double4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double3x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref double M14 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref double M23 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref double M24 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref double M32 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref double M33 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref double M34 => throw new InvalidExecutionContextException($"{typeof(Double3x4)}.M34"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double3x4(double x) + { + Double3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double3x4 operator -(Double3x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Double3x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double3x4 operator +(Double3x4 left, Double3x4 right) => throw new InvalidExecutionContextException($"{nameof(Double3x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double3x4 operator /(Double3x4 left, Double3x4 right) => throw new InvalidExecutionContextException($"{nameof(Double3x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double3x4 operator *(Double3x4 left, Double3x4 right) => throw new InvalidExecutionContextException($"{nameof(Double3x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double3x4 operator -(Double3x4 left, Double3x4 right) => throw new InvalidExecutionContextException($"{nameof(Double3x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 8)] + public partial struct Double4x1 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m21; + + [FieldOffset(16)] + private double m31; + + [FieldOffset(24)] + private double m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Double4x1(double m11, double m21, double m31, double m41) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref double this[int row] => throw new InvalidExecutionContextException($"{nameof(Double4x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double4x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double4x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double4x1)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref double M41 => throw new InvalidExecutionContextException($"{typeof(Double4x1)}.M41"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double4x1(double x) + { + Double4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double4x1 operator -(Double4x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Double4x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double4x1 operator +(Double4x1 left, Double4x1 right) => throw new InvalidExecutionContextException($"{nameof(Double4x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double4x1 operator /(Double4x1 left, Double4x1 right) => throw new InvalidExecutionContextException($"{nameof(Double4x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double4x1 operator *(Double4x1 left, Double4x1 right) => throw new InvalidExecutionContextException($"{nameof(Double4x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double4x1 operator -(Double4x1 left, Double4x1 right) => throw new InvalidExecutionContextException($"{nameof(Double4x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double4(Double4x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Double4x1)}.{nameof(Double4)}({nameof(Double4x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 8)] + public partial struct Double4x2 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m21; + + [FieldOffset(24)] + private double m22; + + [FieldOffset(32)] + private double m31; + + [FieldOffset(40)] + private double m32; + + [FieldOffset(48)] + private double m41; + + [FieldOffset(56)] + private double m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Double4x2(double m11, double m12, double m21, double m22, double m31, double m32, double m41, double m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Double4x2(Double2 row1, Double2 row2, Double2 row3, Double2 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double4x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref double M32 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref double M41 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref double M42 => throw new InvalidExecutionContextException($"{typeof(Double4x2)}.M42"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double4x2(double x) + { + Double4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double4x2 operator -(Double4x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Double4x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double4x2 operator +(Double4x2 left, Double4x2 right) => throw new InvalidExecutionContextException($"{nameof(Double4x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double4x2 operator /(Double4x2 left, Double4x2 right) => throw new InvalidExecutionContextException($"{nameof(Double4x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double4x2 operator *(Double4x2 left, Double4x2 right) => throw new InvalidExecutionContextException($"{nameof(Double4x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double4x2 operator -(Double4x2 left, Double4x2 right) => throw new InvalidExecutionContextException($"{nameof(Double4x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 96, Pack = 8)] + public partial struct Double4x3 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m21; + + [FieldOffset(32)] + private double m22; + + [FieldOffset(40)] + private double m23; + + [FieldOffset(48)] + private double m31; + + [FieldOffset(56)] + private double m32; + + [FieldOffset(64)] + private double m33; + + [FieldOffset(72)] + private double m41; + + [FieldOffset(80)] + private double m42; + + [FieldOffset(88)] + private double m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Double4x3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33, double m41, double m42, double m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Double4x3(Double3 row1, Double3 row2, Double3 row3, Double3 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double4x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref double M23 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref double M32 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref double M33 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref double M41 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref double M42 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref double M43 => throw new InvalidExecutionContextException($"{typeof(Double4x3)}.M43"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double4x3(double x) + { + Double4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double4x3 operator -(Double4x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Double4x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double4x3 operator +(Double4x3 left, Double4x3 right) => throw new InvalidExecutionContextException($"{nameof(Double4x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double4x3 operator /(Double4x3 left, Double4x3 right) => throw new InvalidExecutionContextException($"{nameof(Double4x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double4x3 operator *(Double4x3 left, Double4x3 right) => throw new InvalidExecutionContextException($"{nameof(Double4x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double4x3 operator -(Double4x3 left, Double4x3 right) => throw new InvalidExecutionContextException($"{nameof(Double4x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 128, Pack = 8)] + public partial struct Double4x4 + { + [FieldOffset(0)] + private double m11; + + [FieldOffset(8)] + private double m12; + + [FieldOffset(16)] + private double m13; + + [FieldOffset(24)] + private double m14; + + [FieldOffset(32)] + private double m21; + + [FieldOffset(40)] + private double m22; + + [FieldOffset(48)] + private double m23; + + [FieldOffset(56)] + private double m24; + + [FieldOffset(64)] + private double m31; + + [FieldOffset(72)] + private double m32; + + [FieldOffset(80)] + private double m33; + + [FieldOffset(88)] + private double m34; + + [FieldOffset(96)] + private double m41; + + [FieldOffset(104)] + private double m42; + + [FieldOffset(112)] + private double m43; + + [FieldOffset(120)] + private double m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Double4x4(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Double4x4(Double4 row1, Double4 row2, Double4 row3, Double4 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Double4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Double4x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Double2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Double4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Double3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Double4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Double4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Double4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref double M11 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref double M12 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref double M13 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref double M14 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref double M21 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref double M22 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref double M23 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref double M24 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref double M31 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref double M32 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref double M33 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref double M34 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M34"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref double M41 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref double M42 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref double M43 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M43"); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public ref double M44 => throw new InvalidExecutionContextException($"{typeof(Double4x4)}.M44"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Double4x4(double x) + { + Double4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Double4x4 operator -(Double4x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Double4x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Double4x4 operator +(Double4x4 left, Double4x4 right) => throw new InvalidExecutionContextException($"{nameof(Double4x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Double4x4 operator /(Double4x4 left, Double4x4 right) => throw new InvalidExecutionContextException($"{nameof(Double4x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Double4x4 operator *(Double4x4 left, Double4x4 right) => throw new InvalidExecutionContextException($"{nameof(Double4x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Double4x4 operator -(Double4x4 left, Double4x4 right) => throw new InvalidExecutionContextException($"{nameof(Double4x4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.tt b/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.tt new file mode 100644 index 00000000..6ecc4f82 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Double/DoubleMxN.tt @@ -0,0 +1,4 @@ +<#@include file="..\MatrixType.ttinclude" #> +<# +GenerateAllMatrixProperties("Double", sizeof(double)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.cs b/src/ComputeSharp/Core/Primitives/Float/Float2.cs new file mode 100644 index 00000000..9ca796f5 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float2.cs @@ -0,0 +1,80 @@ +using System.Diagnostics; +using System.Numerics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y})")] + public partial struct Float2 + { + /// + /// Gets an value with all components set to 0. + /// + public static Float2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Float2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float2 UnitY => new(0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + public Float2(float x, float y) + { + this.x = x; + this.y = y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float2(float x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Vector2(Float2 xy) => *(Vector2*)&xy; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Float2(Vector2 xy) => *(Float2*)&xy; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double2(Float2 xy) => throw new InvalidExecutionContextException($"{nameof(Float2)}.({nameof(Double2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int2(Float2 xy) => throw new InvalidExecutionContextException($"{nameof(Float2)}.({nameof(Int2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt2(Float2 xy) => throw new InvalidExecutionContextException($"{nameof(Float2)}.({nameof(UInt2)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs b/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs new file mode 100644 index 00000000..c291ece6 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float2.g.cs @@ -0,0 +1,256 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Float2 + { + [FieldOffset(0)] + private float x; + + [FieldOffset(4)] + private float y; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref float this[int i] => throw new InvalidExecutionContextException($"{nameof(Float2)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref float X => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref float Y => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref float Z => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref float W => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 XX => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XY => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XZ => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XW => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YX => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 YY => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YZ => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YW => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZX => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZY => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 ZZ => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZW => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WX => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WY => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WZ => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 WW => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(WW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref float R => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref float G => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref float B => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref float A => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 RR => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RG => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RB => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RA => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GR => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 GG => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GB => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GA => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BR => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BG => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 BB => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BA => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AR => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AG => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AB => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 AA => throw new InvalidExecutionContextException($"{nameof(Float2)}.{nameof(AA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float2 operator -(Float2 xy) => throw new InvalidExecutionContextException($"{nameof(Float2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float2 operator +(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Float2 operator /(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float2 operator *(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float2 operator -(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{nameof(Float2)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Float/Float2.tt b/src/ComputeSharp/Core/Primitives/Float/Float2.tt new file mode 100644 index 00000000..d2da688a --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float2.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Float2", sizeof(float)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.cs b/src/ComputeSharp/Core/Primitives/Float/Float3.cs new file mode 100644 index 00000000..81497f02 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float3.cs @@ -0,0 +1,111 @@ +using System.Diagnostics; +using System.Numerics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z})")] + public partial struct Float3 + { + /// + /// Gets an value with all components set to 0. + /// + public static Float3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Float3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float3 UnitZ => new(0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + public Float3(float x, float y, float z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Float3(Float2 xy, float z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Float3(float x, Float2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float3(float x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Vector3(Float3 xyz) => *(Vector3*)&xyz; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Float3(Vector3 xyz) => *(Float3*)&xyz; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double3(Float3 xyz) => throw new InvalidExecutionContextException($"{nameof(Float3)}.({nameof(Double3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int3(Float3 xyz) => throw new InvalidExecutionContextException($"{nameof(Float3)}.({nameof(Int3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt3(Float3 xyz) => throw new InvalidExecutionContextException($"{nameof(Float3)}.({nameof(UInt3)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs b/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs new file mode 100644 index 00000000..aee2eb71 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float3.g.cs @@ -0,0 +1,899 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Float3 + { + [FieldOffset(0)] + private float x; + + [FieldOffset(4)] + private float y; + + [FieldOffset(8)] + private float z; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref float this[int i] => throw new InvalidExecutionContextException($"{nameof(Float3)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref float X => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref float Y => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref float Z => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref float W => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 XX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 YY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 ZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 WW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XYX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XYY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XYZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XYW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XZX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XZY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XZW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XWX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XWY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XWZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XWW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YXX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YXY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YXZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YXW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YZX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YZY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YZW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YWX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YWY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YWZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YWW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZXX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZXY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZXW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZYX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZYY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZYW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZWX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZWY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZWW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WXX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WXY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WXZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WXW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WYX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WYY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WYZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WYW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WZX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WZY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WZZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WZW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWX => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWY => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWZ => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWW => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(WWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref float R => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref float G => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref float B => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref float A => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 RR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 GG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 BB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 AA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RGR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RGG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RGB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RGA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RBR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RBG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RBB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RBA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RAR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RAG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RAB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RAA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GRR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GRG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GRB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GRA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GBR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GBG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GBB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GBA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GAR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GAG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GAB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GAA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BRR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BRG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BRB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BRA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BGR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BGG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BGB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BGA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BAR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BAG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BAB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BAA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ARR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ARG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ARB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ARA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 AGR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AGG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 AGB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AGA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ABR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ABG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ABB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ABA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAR => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAG => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAB => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAA => throw new InvalidExecutionContextException($"{nameof(Float3)}.{nameof(AAA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float3 operator -(Float3 xyz) => throw new InvalidExecutionContextException($"{nameof(Float3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float3 operator +(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Float3 operator /(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float3 operator *(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float3 operator -(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{nameof(Float3)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Float/Float3.tt b/src/ComputeSharp/Core/Primitives/Float/Float3.tt new file mode 100644 index 00000000..3b3852bc --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float3.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Float3", sizeof(float)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.cs b/src/ComputeSharp/Core/Primitives/Float/Float4.cs new file mode 100644 index 00000000..0571ccd0 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float4.cs @@ -0,0 +1,161 @@ +using System.Diagnostics; +using System.Numerics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] + public partial struct Float4 + { + /// + /// Gets an value with all components set to 0. + /// + public static Float4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Float4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Float4 UnitW => new(0, 0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Float4(float x, float y, float z, float w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Float4(Float2 xy, float z, float w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third and fourth vector components. + public Float4(float x, float y, Float2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Float4(Float2 xy, Float2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Float4(Float3 xyz, float w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Float4(float x, Float3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float4(float x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Vector4(Float4 xyzw) => *(Vector4*)&xyzw; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static unsafe implicit operator Float4(Vector4 xyzw) => *(Float4*)&xyzw; + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double4(Float4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Float4)}.({nameof(Double4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int4(Float4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Float4)}.({nameof(Int4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt4(Float4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Float4)}.({nameof(UInt4)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs b/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs new file mode 100644 index 00000000..c1aefc70 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float4.g.cs @@ -0,0 +1,3462 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Float4 + { + [FieldOffset(0)] + private float x; + + [FieldOffset(4)] + private float y; + + [FieldOffset(8)] + private float z; + + [FieldOffset(12)] + private float w; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref float this[int i] => throw new InvalidExecutionContextException($"{nameof(Float4)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref float X => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref float Y => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref float Z => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref float W => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 XX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 XW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 YY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 YW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 ZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 ZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 WZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 WW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 XWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 XWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 YWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 YWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 WZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 WWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 XYZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 XYWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 XZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 XZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 XWYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 XWZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 XWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(XWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 YXZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 YXWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 YZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 YZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 YWXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 YWZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 YWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(YWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ZXYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ZXWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ZYXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ZYWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ZWXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ZWYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ZWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 WXYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 WXZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WXWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 WYXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 WYZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WYWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 WZXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 WZYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WZWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWXX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWXY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWXW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWYX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWYY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWYW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWZX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWZY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWZW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWWX => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWWY => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 WWWW => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(WWWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref float R => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref float G => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref float B => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref float A => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 RR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 RA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 GG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 GA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 BB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 BA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Float2 AB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Float2 AA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 RAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 RAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 GAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 GAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 BAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 BAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 AGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 AGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Float3 ABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 ABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Float3 AAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RRAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 RGBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 RGAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 RBGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 RBAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RBAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RAGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 RAGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 RABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 RAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(RAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 GRBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 GRAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GRAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 GBRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 GBAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GBAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 GARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 GABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 GAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(GAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 BRGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 BRAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BRAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 BGRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 BGAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BBAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 BARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BARA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 BAGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BAGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 BAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(BAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ARGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ARBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ARAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ARAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 AGRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 AGBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AGAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABRR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ABRG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABRB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABRA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABRA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Float4 ABGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABBR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABBG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABBB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABBA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 ABAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(ABAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AARR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AARG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AARB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AARA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAGR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAGG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAGB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAGA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AABR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AABG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AABB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AABA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAAR => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAAG => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAAB => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Float4 AAAA => throw new InvalidExecutionContextException($"{nameof(Float4)}.{nameof(AAAA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float4 operator -(Float4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Float4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float4 operator +(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Float4 operator /(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float4 operator *(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float4 operator -(Float4 left, Float4 right) => throw new InvalidExecutionContextException($"{nameof(Float4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Float/Float4.tt b/src/ComputeSharp/Core/Primitives/Float/Float4.tt new file mode 100644 index 00000000..7bcc833d --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/Float4.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Float4", sizeof(float)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs b/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs new file mode 100644 index 00000000..889e0435 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/FloatMxN.g.cs @@ -0,0 +1,2720 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] + public partial struct Float1x1 + { + [FieldOffset(0)] + private float m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Float1x1(float m11) + { + this.m11 = m11; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref float this[int row] => throw new InvalidExecutionContextException($"{nameof(Float1x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float1x1)}.M11"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float1x1(float x) + { + Float1x1 matrix; + + matrix.m11 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float1x1 operator -(Float1x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Float1x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float1x1 operator +(Float1x1 left, Float1x1 right) => throw new InvalidExecutionContextException($"{nameof(Float1x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float1x1 operator /(Float1x1 left, Float1x1 right) => throw new InvalidExecutionContextException($"{nameof(Float1x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float1x1 operator *(Float1x1 left, Float1x1 right) => throw new InvalidExecutionContextException($"{nameof(Float1x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float1x1 operator -(Float1x1 left, Float1x1 right) => throw new InvalidExecutionContextException($"{nameof(Float1x1)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Float1x2 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Float1x2(float m11, float m12) + { + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float1x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float1x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float1x2)}.M12"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float1x2(float x) + { + Float1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float1x2 operator -(Float1x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Float1x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float1x2 operator +(Float1x2 left, Float1x2 right) => throw new InvalidExecutionContextException($"{nameof(Float1x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float1x2 operator /(Float1x2 left, Float1x2 right) => throw new InvalidExecutionContextException($"{nameof(Float1x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float1x2 operator *(Float1x2 left, Float1x2 right) => throw new InvalidExecutionContextException($"{nameof(Float1x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float1x2 operator -(Float1x2 left, Float1x2 right) => throw new InvalidExecutionContextException($"{nameof(Float1x2)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float1x2(Float2 vector) => throw new InvalidExecutionContextException($"{typeof(Float1x2)}.{nameof(Float1x2)}({nameof(Float2)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Float1x3 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Float1x3(float m11, float m12, float m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float1x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float1x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float1x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float1x3)}.M13"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float1x3(float x) + { + Float1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float1x3 operator -(Float1x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Float1x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float1x3 operator +(Float1x3 left, Float1x3 right) => throw new InvalidExecutionContextException($"{nameof(Float1x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float1x3 operator /(Float1x3 left, Float1x3 right) => throw new InvalidExecutionContextException($"{nameof(Float1x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float1x3 operator *(Float1x3 left, Float1x3 right) => throw new InvalidExecutionContextException($"{nameof(Float1x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float1x3 operator -(Float1x3 left, Float1x3 right) => throw new InvalidExecutionContextException($"{nameof(Float1x3)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float1x3(Float3 vector) => throw new InvalidExecutionContextException($"{typeof(Float1x3)}.{nameof(Float1x3)}({nameof(Float3)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Float1x4 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Float1x4(float m11, float m12, float m13, float m14) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float1x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float1x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float1x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float1x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref float M14 => throw new InvalidExecutionContextException($"{typeof(Float1x4)}.M14"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float1x4(float x) + { + Float1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float1x4 operator -(Float1x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Float1x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float1x4 operator +(Float1x4 left, Float1x4 right) => throw new InvalidExecutionContextException($"{nameof(Float1x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float1x4 operator /(Float1x4 left, Float1x4 right) => throw new InvalidExecutionContextException($"{nameof(Float1x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float1x4 operator *(Float1x4 left, Float1x4 right) => throw new InvalidExecutionContextException($"{nameof(Float1x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float1x4 operator -(Float1x4 left, Float1x4 right) => throw new InvalidExecutionContextException($"{nameof(Float1x4)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float1x4(Float4 vector) => throw new InvalidExecutionContextException($"{typeof(Float1x4)}.{nameof(Float1x4)}({nameof(Float4)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Float2x1 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Float2x1(float m11, float m21) + { + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref float this[int row] => throw new InvalidExecutionContextException($"{nameof(Float2x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float2x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float2x1)}.M21"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float2x1(float x) + { + Float2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float2x1 operator -(Float2x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Float2x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float2x1 operator +(Float2x1 left, Float2x1 right) => throw new InvalidExecutionContextException($"{nameof(Float2x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float2x1 operator /(Float2x1 left, Float2x1 right) => throw new InvalidExecutionContextException($"{nameof(Float2x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float2x1 operator *(Float2x1 left, Float2x1 right) => throw new InvalidExecutionContextException($"{nameof(Float2x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float2x1 operator -(Float2x1 left, Float2x1 right) => throw new InvalidExecutionContextException($"{nameof(Float2x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float2(Float2x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Float2x1)}.{nameof(Float2)}({nameof(Float2x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Float2x2 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m21; + + [FieldOffset(12)] + private float m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Float2x2(float m11, float m12, float m21, float m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Float2x2(Float2 row1, Float2 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float2x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float2x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float2x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float2x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float2x2)}.M22"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float2x2(float x) + { + Float2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float2x2 operator -(Float2x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Float2x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float2x2 operator +(Float2x2 left, Float2x2 right) => throw new InvalidExecutionContextException($"{nameof(Float2x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float2x2 operator /(Float2x2 left, Float2x2 right) => throw new InvalidExecutionContextException($"{nameof(Float2x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float2x2 operator *(Float2x2 left, Float2x2 right) => throw new InvalidExecutionContextException($"{nameof(Float2x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float2x2 operator -(Float2x2 left, Float2x2 right) => throw new InvalidExecutionContextException($"{nameof(Float2x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct Float2x3 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m21; + + [FieldOffset(16)] + private float m22; + + [FieldOffset(20)] + private float m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Float2x3(float m11, float m12, float m13, float m21, float m22, float m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Float2x3(Float3 row1, Float3 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float2x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float2x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float2x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float2x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float2x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float2x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref float M23 => throw new InvalidExecutionContextException($"{typeof(Float2x3)}.M23"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float2x3(float x) + { + Float2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float2x3 operator -(Float2x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Float2x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float2x3 operator +(Float2x3 left, Float2x3 right) => throw new InvalidExecutionContextException($"{nameof(Float2x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float2x3 operator /(Float2x3 left, Float2x3 right) => throw new InvalidExecutionContextException($"{nameof(Float2x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float2x3 operator *(Float2x3 left, Float2x3 right) => throw new InvalidExecutionContextException($"{nameof(Float2x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float2x3 operator -(Float2x3 left, Float2x3 right) => throw new InvalidExecutionContextException($"{nameof(Float2x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct Float2x4 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + [FieldOffset(16)] + private float m21; + + [FieldOffset(20)] + private float m22; + + [FieldOffset(24)] + private float m23; + + [FieldOffset(28)] + private float m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Float2x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Float2x4(Float4 row1, Float4 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float2x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref float M14 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref float M23 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref float M24 => throw new InvalidExecutionContextException($"{typeof(Float2x4)}.M24"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float2x4(float x) + { + Float2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float2x4 operator -(Float2x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Float2x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float2x4 operator +(Float2x4 left, Float2x4 right) => throw new InvalidExecutionContextException($"{nameof(Float2x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float2x4 operator /(Float2x4 left, Float2x4 right) => throw new InvalidExecutionContextException($"{nameof(Float2x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float2x4 operator *(Float2x4 left, Float2x4 right) => throw new InvalidExecutionContextException($"{nameof(Float2x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float2x4 operator -(Float2x4 left, Float2x4 right) => throw new InvalidExecutionContextException($"{nameof(Float2x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Float3x1 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m21; + + [FieldOffset(8)] + private float m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Float3x1(float m11, float m21, float m31) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref float this[int row] => throw new InvalidExecutionContextException($"{nameof(Float3x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float3x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float3x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float3x1)}.M31"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float3x1(float x) + { + Float3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float3x1 operator -(Float3x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Float3x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float3x1 operator +(Float3x1 left, Float3x1 right) => throw new InvalidExecutionContextException($"{nameof(Float3x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float3x1 operator /(Float3x1 left, Float3x1 right) => throw new InvalidExecutionContextException($"{nameof(Float3x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float3x1 operator *(Float3x1 left, Float3x1 right) => throw new InvalidExecutionContextException($"{nameof(Float3x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float3x1 operator -(Float3x1 left, Float3x1 right) => throw new InvalidExecutionContextException($"{nameof(Float3x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float3(Float3x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Float3x1)}.{nameof(Float3)}({nameof(Float3x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct Float3x2 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m21; + + [FieldOffset(12)] + private float m22; + + [FieldOffset(16)] + private float m31; + + [FieldOffset(20)] + private float m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Float3x2(float m11, float m12, float m21, float m22, float m31, float m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Float3x2(Float2 row1, Float2 row2, Float2 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float3x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float3x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float3x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float3x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float3x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float3x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref float M32 => throw new InvalidExecutionContextException($"{typeof(Float3x2)}.M32"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float3x2(float x) + { + Float3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float3x2 operator -(Float3x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Float3x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float3x2 operator +(Float3x2 left, Float3x2 right) => throw new InvalidExecutionContextException($"{nameof(Float3x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float3x2 operator /(Float3x2 left, Float3x2 right) => throw new InvalidExecutionContextException($"{nameof(Float3x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float3x2 operator *(Float3x2 left, Float3x2 right) => throw new InvalidExecutionContextException($"{nameof(Float3x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float3x2 operator -(Float3x2 left, Float3x2 right) => throw new InvalidExecutionContextException($"{nameof(Float3x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] + public partial struct Float3x3 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m21; + + [FieldOffset(16)] + private float m22; + + [FieldOffset(20)] + private float m23; + + [FieldOffset(24)] + private float m31; + + [FieldOffset(28)] + private float m32; + + [FieldOffset(32)] + private float m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Float3x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Float3x3(Float3 row1, Float3 row2, Float3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float3x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref float M23 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref float M32 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref float M33 => throw new InvalidExecutionContextException($"{typeof(Float3x3)}.M33"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float3x3(float x) + { + Float3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float3x3 operator -(Float3x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Float3x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float3x3 operator +(Float3x3 left, Float3x3 right) => throw new InvalidExecutionContextException($"{nameof(Float3x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float3x3 operator /(Float3x3 left, Float3x3 right) => throw new InvalidExecutionContextException($"{nameof(Float3x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float3x3 operator *(Float3x3 left, Float3x3 right) => throw new InvalidExecutionContextException($"{nameof(Float3x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float3x3 operator -(Float3x3 left, Float3x3 right) => throw new InvalidExecutionContextException($"{nameof(Float3x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct Float3x4 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + [FieldOffset(16)] + private float m21; + + [FieldOffset(20)] + private float m22; + + [FieldOffset(24)] + private float m23; + + [FieldOffset(28)] + private float m24; + + [FieldOffset(32)] + private float m31; + + [FieldOffset(36)] + private float m32; + + [FieldOffset(40)] + private float m33; + + [FieldOffset(44)] + private float m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Float3x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Float3x4(Float4 row1, Float4 row2, Float4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float3x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref float M14 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref float M23 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref float M24 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref float M32 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref float M33 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref float M34 => throw new InvalidExecutionContextException($"{typeof(Float3x4)}.M34"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float3x4(float x) + { + Float3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float3x4 operator -(Float3x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Float3x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float3x4 operator +(Float3x4 left, Float3x4 right) => throw new InvalidExecutionContextException($"{nameof(Float3x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float3x4 operator /(Float3x4 left, Float3x4 right) => throw new InvalidExecutionContextException($"{nameof(Float3x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float3x4 operator *(Float3x4 left, Float3x4 right) => throw new InvalidExecutionContextException($"{nameof(Float3x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float3x4 operator -(Float3x4 left, Float3x4 right) => throw new InvalidExecutionContextException($"{nameof(Float3x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Float4x1 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m21; + + [FieldOffset(8)] + private float m31; + + [FieldOffset(12)] + private float m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Float4x1(float m11, float m21, float m31, float m41) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref float this[int row] => throw new InvalidExecutionContextException($"{nameof(Float4x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float4x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float4x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float4x1)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref float M41 => throw new InvalidExecutionContextException($"{typeof(Float4x1)}.M41"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float4x1(float x) + { + Float4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float4x1 operator -(Float4x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Float4x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float4x1 operator +(Float4x1 left, Float4x1 right) => throw new InvalidExecutionContextException($"{nameof(Float4x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float4x1 operator /(Float4x1 left, Float4x1 right) => throw new InvalidExecutionContextException($"{nameof(Float4x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float4x1 operator *(Float4x1 left, Float4x1 right) => throw new InvalidExecutionContextException($"{nameof(Float4x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float4x1 operator -(Float4x1 left, Float4x1 right) => throw new InvalidExecutionContextException($"{nameof(Float4x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float4(Float4x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Float4x1)}.{nameof(Float4)}({nameof(Float4x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct Float4x2 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m21; + + [FieldOffset(12)] + private float m22; + + [FieldOffset(16)] + private float m31; + + [FieldOffset(20)] + private float m32; + + [FieldOffset(24)] + private float m41; + + [FieldOffset(28)] + private float m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Float4x2(float m11, float m12, float m21, float m22, float m31, float m32, float m41, float m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Float4x2(Float2 row1, Float2 row2, Float2 row3, Float2 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float4x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref float M32 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref float M41 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref float M42 => throw new InvalidExecutionContextException($"{typeof(Float4x2)}.M42"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float4x2(float x) + { + Float4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float4x2 operator -(Float4x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Float4x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float4x2 operator +(Float4x2 left, Float4x2 right) => throw new InvalidExecutionContextException($"{nameof(Float4x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float4x2 operator /(Float4x2 left, Float4x2 right) => throw new InvalidExecutionContextException($"{nameof(Float4x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float4x2 operator *(Float4x2 left, Float4x2 right) => throw new InvalidExecutionContextException($"{nameof(Float4x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float4x2 operator -(Float4x2 left, Float4x2 right) => throw new InvalidExecutionContextException($"{nameof(Float4x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct Float4x3 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m21; + + [FieldOffset(16)] + private float m22; + + [FieldOffset(20)] + private float m23; + + [FieldOffset(24)] + private float m31; + + [FieldOffset(28)] + private float m32; + + [FieldOffset(32)] + private float m33; + + [FieldOffset(36)] + private float m41; + + [FieldOffset(40)] + private float m42; + + [FieldOffset(44)] + private float m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Float4x3(float m11, float m12, float m13, float m21, float m22, float m23, float m31, float m32, float m33, float m41, float m42, float m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Float4x3(Float3 row1, Float3 row2, Float3 row3, Float3 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float4x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref float M23 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref float M32 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref float M33 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref float M41 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref float M42 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref float M43 => throw new InvalidExecutionContextException($"{typeof(Float4x3)}.M43"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float4x3(float x) + { + Float4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float4x3 operator -(Float4x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Float4x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float4x3 operator +(Float4x3 left, Float4x3 right) => throw new InvalidExecutionContextException($"{nameof(Float4x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float4x3 operator /(Float4x3 left, Float4x3 right) => throw new InvalidExecutionContextException($"{nameof(Float4x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float4x3 operator *(Float4x3 left, Float4x3 right) => throw new InvalidExecutionContextException($"{nameof(Float4x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float4x3 operator -(Float4x3 left, Float4x3 right) => throw new InvalidExecutionContextException($"{nameof(Float4x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] + public partial struct Float4x4 + { + [FieldOffset(0)] + private float m11; + + [FieldOffset(4)] + private float m12; + + [FieldOffset(8)] + private float m13; + + [FieldOffset(12)] + private float m14; + + [FieldOffset(16)] + private float m21; + + [FieldOffset(20)] + private float m22; + + [FieldOffset(24)] + private float m23; + + [FieldOffset(28)] + private float m24; + + [FieldOffset(32)] + private float m31; + + [FieldOffset(36)] + private float m32; + + [FieldOffset(40)] + private float m33; + + [FieldOffset(44)] + private float m34; + + [FieldOffset(48)] + private float m41; + + [FieldOffset(52)] + private float m42; + + [FieldOffset(56)] + private float m43; + + [FieldOffset(60)] + private float m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Float4x4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Float4x4(Float4 row1, Float4 row2, Float4 row3, Float4 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Float4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Float4x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Float2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Float4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Float3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Float4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Float4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Float4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref float M11 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref float M12 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref float M13 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref float M14 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref float M21 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref float M22 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref float M23 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref float M24 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref float M31 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref float M32 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref float M33 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref float M34 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M34"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref float M41 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref float M42 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref float M43 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M43"); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public ref float M44 => throw new InvalidExecutionContextException($"{typeof(Float4x4)}.M44"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Float4x4(float x) + { + Float4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Float4x4 operator -(Float4x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Float4x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Float4x4 operator +(Float4x4 left, Float4x4 right) => throw new InvalidExecutionContextException($"{nameof(Float4x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Float4x4 operator /(Float4x4 left, Float4x4 right) => throw new InvalidExecutionContextException($"{nameof(Float4x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Float4x4 operator *(Float4x4 left, Float4x4 right) => throw new InvalidExecutionContextException($"{nameof(Float4x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Float4x4 operator -(Float4x4 left, Float4x4 right) => throw new InvalidExecutionContextException($"{nameof(Float4x4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Float/FloatMxN.tt b/src/ComputeSharp/Core/Primitives/Float/FloatMxN.tt new file mode 100644 index 00000000..97755751 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Float/FloatMxN.tt @@ -0,0 +1,4 @@ +<#@include file="..\MatrixType.ttinclude" #> +<# +GenerateAllMatrixProperties("Float", sizeof(float)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.cs b/src/ComputeSharp/Core/Primitives/Int/Int2.cs new file mode 100644 index 00000000..8cc711ff --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int2.cs @@ -0,0 +1,67 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y})")] + public partial struct Int2 + { + /// + /// Gets an value with all components set to 0. + /// + public static Int2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Int2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int2 UnitY => new(0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + public Int2(int x, int y) + { + this.x = x; + this.y = y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int2(int x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(UInt2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(Float2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(Double2)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs b/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs new file mode 100644 index 00000000..a2c58948 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int2.g.cs @@ -0,0 +1,256 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Int2 + { + [FieldOffset(0)] + private int x; + + [FieldOffset(4)] + private int y; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref int this[int i] => throw new InvalidExecutionContextException($"{nameof(Int2)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref int X => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref int Y => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref int Z => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref int W => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 XX => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XY => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XZ => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XW => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YX => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 YY => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YZ => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YW => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZX => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZY => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZW => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WX => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WY => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WZ => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 WW => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(WW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref int R => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref int G => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref int B => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref int A => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 RR => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RG => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RB => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RA => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GR => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 GG => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GB => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GA => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BR => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BG => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 BB => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BA => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AR => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AG => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AB => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 AA => throw new InvalidExecutionContextException($"{nameof(Int2)}.{nameof(AA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int2 operator -(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int2 operator +(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Int2 operator /(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int2 operator *(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int2 operator -(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{nameof(Int2)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Int/Int2.tt b/src/ComputeSharp/Core/Primitives/Int/Int2.tt new file mode 100644 index 00000000..cbd0613b --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int2.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Int2", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.cs b/src/ComputeSharp/Core/Primitives/Int/Int3.cs new file mode 100644 index 00000000..1a7a30b6 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int3.cs @@ -0,0 +1,98 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z})")] + public partial struct Int3 + { + /// + /// Gets an value with all components set to 0. + /// + public static Int3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Int3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int3 UnitZ => new(0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + public Int3(int x, int y, int z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public Int3(Int2 xy, int z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public Int3(int x, Int2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int3(int x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt3(Int3 xyz) => throw new InvalidExecutionContextException($"{nameof(Int3)}.({nameof(UInt3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float3(Int3 xyz) => throw new InvalidExecutionContextException($"{nameof(Int3)}.({nameof(Float3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double3(Int3 xyz) => throw new InvalidExecutionContextException($"{nameof(Int3)}.({nameof(Double3)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs b/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs new file mode 100644 index 00000000..9378ed8b --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int3.g.cs @@ -0,0 +1,899 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Int3 + { + [FieldOffset(0)] + private int x; + + [FieldOffset(4)] + private int y; + + [FieldOffset(8)] + private int z; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref int this[int i] => throw new InvalidExecutionContextException($"{nameof(Int3)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref int X => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref int Y => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref int Z => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref int W => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 XX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 YY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 WW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XYX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XYY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XYZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XYW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XZX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XZY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XZW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XWX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XWY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XWZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XWW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YXX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YXY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YXZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YXW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YZX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YZY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YZW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YWX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YWY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YWZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YWW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZXX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZXY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZXW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZYX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZYY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZYW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZWX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZWY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZWW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WXX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WXY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WXZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WXW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WYX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WYY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WYZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WYW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WZX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WZY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WZZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WZW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWX => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWY => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWZ => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWW => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(WWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref int R => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref int G => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref int B => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref int A => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 RR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 GG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 BB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 AA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RGR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RGG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RGB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RGA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RBR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RBG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RBB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RBA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RAR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RAG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RAB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RAA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GRR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GRG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GRB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GRA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GBR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GBG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GBB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GBA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GAR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GAG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GAB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GAA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BRR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BRG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BRB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BRA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BGR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BGG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BGB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BGA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BAR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BAG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BAB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BAA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ARR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ARG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ARB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ARA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 AGR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AGG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 AGB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AGA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ABR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ABG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ABB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ABA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAR => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAG => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAB => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAA => throw new InvalidExecutionContextException($"{nameof(Int3)}.{nameof(AAA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int3 operator -(Int3 xyz) => throw new InvalidExecutionContextException($"{nameof(Int3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int3 operator +(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Int3 operator /(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int3 operator *(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int3 operator -(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{nameof(Int3)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Int/Int3.tt b/src/ComputeSharp/Core/Primitives/Int/Int3.tt new file mode 100644 index 00000000..78b16504 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int3.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Int3", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.cs b/src/ComputeSharp/Core/Primitives/Int/Int4.cs new file mode 100644 index 00000000..f7dd8298 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int4.cs @@ -0,0 +1,148 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] + public partial struct Int4 + { + /// + /// Gets an value with all components set to 0. + /// + public static Int4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static Int4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static Int4 UnitW => new(0, 0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Int4(int x, int y, int z, int w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public Int4(Int2 xy, int z, int w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third and fourth vector components. + public Int4(int x, int y, Int2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public Int4(Int2 xy, Int2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public Int4(Int3 xyz, int w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public Int4(int x, Int3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int4(int x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator UInt4(Int4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Int4)}.({nameof(UInt4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float4(Int4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Int4)}.({nameof(Float4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double4(Int4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Int4)}.({nameof(Double4)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs b/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs new file mode 100644 index 00000000..c4a2f3fc --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int4.g.cs @@ -0,0 +1,3462 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Int4 + { + [FieldOffset(0)] + private int x; + + [FieldOffset(4)] + private int y; + + [FieldOffset(8)] + private int z; + + [FieldOffset(12)] + private int w; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref int this[int i] => throw new InvalidExecutionContextException($"{nameof(Int4)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref int X => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref int Y => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref int Z => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref int W => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 XX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 XW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 YY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 YW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 ZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 ZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 WZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 WW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 XWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 XWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 YWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 YWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 WZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 WWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 XYZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 XYWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 XZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 XZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 XWYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 XWZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 XWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(XWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 YXZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 YXWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 YZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 YZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 YWXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 YWZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 YWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(YWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ZXYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ZXWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ZYXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ZYWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ZWXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ZWYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ZWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ZWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 WXYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 WXZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WXWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 WYXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 WYZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WYWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 WZXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 WZYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WZWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWXX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWXY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWXZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWXW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWYX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWYY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWYZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWYW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWZX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWZY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWZZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWZW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWWX => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWWY => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWWZ => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 WWWW => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(WWWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref int R => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref int G => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref int B => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref int A => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 RR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 RA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 GG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 GA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 BB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 BA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref Int2 AB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly Int2 AA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 RAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 RAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 GAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 GAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 BAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 BAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 AGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 AGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref Int3 ABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 ABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly Int3 AAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RRAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 RGBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 RGAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 RBGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 RBAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RBAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RAGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 RAGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 RABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 RAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(RAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 GRBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 GRAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GRAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 GBRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 GBAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GBAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 GARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 GABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 GAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(GAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 BRGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 BRAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BRAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 BGRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 BGAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BBAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 BARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BARA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 BAGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BAGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 BAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(BAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ARGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ARBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ARAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ARAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 AGRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 AGBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AGAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABRR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ABRG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABRB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABRA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABRA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref Int4 ABGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABBR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABBG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABBB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABBA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 ABAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(ABAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AARR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AARG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AARB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AARA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAGR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAGG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAGB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAGA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AABR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AABG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AABB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AABA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAAR => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAAG => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAAB => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly Int4 AAAA => throw new InvalidExecutionContextException($"{nameof(Int4)}.{nameof(AAAA)}"); + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int4 operator -(Int4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Int4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int4 operator +(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static Int4 operator /(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int4 operator *(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int4 operator -(Int4 left, Int4 right) => throw new InvalidExecutionContextException($"{nameof(Int4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Int/Int4.tt b/src/ComputeSharp/Core/Primitives/Int/Int4.tt new file mode 100644 index 00000000..655b092c --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/Int4.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("Int4", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs b/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs new file mode 100644 index 00000000..48156d86 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/IntMxN.g.cs @@ -0,0 +1,2720 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] + public partial struct Int1x1 + { + [FieldOffset(0)] + private int m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public Int1x1(int m11) + { + this.m11 = m11; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref int this[int row] => throw new InvalidExecutionContextException($"{nameof(Int1x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int1x1)}.M11"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int1x1(int x) + { + Int1x1 matrix; + + matrix.m11 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int1x1 operator -(Int1x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Int1x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int1x1 operator +(Int1x1 left, Int1x1 right) => throw new InvalidExecutionContextException($"{nameof(Int1x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int1x1 operator /(Int1x1 left, Int1x1 right) => throw new InvalidExecutionContextException($"{nameof(Int1x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int1x1 operator *(Int1x1 left, Int1x1 right) => throw new InvalidExecutionContextException($"{nameof(Int1x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int1x1 operator -(Int1x1 left, Int1x1 right) => throw new InvalidExecutionContextException($"{nameof(Int1x1)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Int1x2 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public Int1x2(int m11, int m12) + { + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int1x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int1x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int1x2)}.M12"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int1x2(int x) + { + Int1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int1x2 operator -(Int1x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Int1x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int1x2 operator +(Int1x2 left, Int1x2 right) => throw new InvalidExecutionContextException($"{nameof(Int1x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int1x2 operator /(Int1x2 left, Int1x2 right) => throw new InvalidExecutionContextException($"{nameof(Int1x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int1x2 operator *(Int1x2 left, Int1x2 right) => throw new InvalidExecutionContextException($"{nameof(Int1x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int1x2 operator -(Int1x2 left, Int1x2 right) => throw new InvalidExecutionContextException($"{nameof(Int1x2)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int1x2(Int2 vector) => throw new InvalidExecutionContextException($"{typeof(Int1x2)}.{nameof(Int1x2)}({nameof(Int2)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Int1x3 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public Int1x3(int m11, int m12, int m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int1x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int1x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int1x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int1x3)}.M13"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int1x3(int x) + { + Int1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int1x3 operator -(Int1x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Int1x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int1x3 operator +(Int1x3 left, Int1x3 right) => throw new InvalidExecutionContextException($"{nameof(Int1x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int1x3 operator /(Int1x3 left, Int1x3 right) => throw new InvalidExecutionContextException($"{nameof(Int1x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int1x3 operator *(Int1x3 left, Int1x3 right) => throw new InvalidExecutionContextException($"{nameof(Int1x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int1x3 operator -(Int1x3 left, Int1x3 right) => throw new InvalidExecutionContextException($"{nameof(Int1x3)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int1x3(Int3 vector) => throw new InvalidExecutionContextException($"{typeof(Int1x3)}.{nameof(Int1x3)}({nameof(Int3)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Int1x4 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public Int1x4(int m11, int m12, int m13, int m14) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int1x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int1x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int1x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int1x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref int M14 => throw new InvalidExecutionContextException($"{typeof(Int1x4)}.M14"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int1x4(int x) + { + Int1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int1x4 operator -(Int1x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Int1x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int1x4 operator +(Int1x4 left, Int1x4 right) => throw new InvalidExecutionContextException($"{nameof(Int1x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int1x4 operator /(Int1x4 left, Int1x4 right) => throw new InvalidExecutionContextException($"{nameof(Int1x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int1x4 operator *(Int1x4 left, Int1x4 right) => throw new InvalidExecutionContextException($"{nameof(Int1x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int1x4 operator -(Int1x4 left, Int1x4 right) => throw new InvalidExecutionContextException($"{nameof(Int1x4)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int1x4(Int4 vector) => throw new InvalidExecutionContextException($"{typeof(Int1x4)}.{nameof(Int1x4)}({nameof(Int4)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct Int2x1 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public Int2x1(int m11, int m21) + { + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref int this[int row] => throw new InvalidExecutionContextException($"{nameof(Int2x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int2x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int2x1)}.M21"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int2x1(int x) + { + Int2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int2x1 operator -(Int2x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Int2x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int2x1 operator +(Int2x1 left, Int2x1 right) => throw new InvalidExecutionContextException($"{nameof(Int2x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int2x1 operator /(Int2x1 left, Int2x1 right) => throw new InvalidExecutionContextException($"{nameof(Int2x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int2x1 operator *(Int2x1 left, Int2x1 right) => throw new InvalidExecutionContextException($"{nameof(Int2x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int2x1 operator -(Int2x1 left, Int2x1 right) => throw new InvalidExecutionContextException($"{nameof(Int2x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int2(Int2x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Int2x1)}.{nameof(Int2)}({nameof(Int2x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Int2x2 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m21; + + [FieldOffset(12)] + private int m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public Int2x2(int m11, int m12, int m21, int m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Int2x2(Int2 row1, Int2 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int2x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int2x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int2x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int2x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int2x2)}.M22"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int2x2(int x) + { + Int2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int2x2 operator -(Int2x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Int2x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int2x2 operator +(Int2x2 left, Int2x2 right) => throw new InvalidExecutionContextException($"{nameof(Int2x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int2x2 operator /(Int2x2 left, Int2x2 right) => throw new InvalidExecutionContextException($"{nameof(Int2x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int2x2 operator *(Int2x2 left, Int2x2 right) => throw new InvalidExecutionContextException($"{nameof(Int2x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int2x2 operator -(Int2x2 left, Int2x2 right) => throw new InvalidExecutionContextException($"{nameof(Int2x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct Int2x3 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m21; + + [FieldOffset(16)] + private int m22; + + [FieldOffset(20)] + private int m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public Int2x3(int m11, int m12, int m13, int m21, int m22, int m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Int2x3(Int3 row1, Int3 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int2x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int2x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int2x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int2x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int2x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int2x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref int M23 => throw new InvalidExecutionContextException($"{typeof(Int2x3)}.M23"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int2x3(int x) + { + Int2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int2x3 operator -(Int2x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Int2x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int2x3 operator +(Int2x3 left, Int2x3 right) => throw new InvalidExecutionContextException($"{nameof(Int2x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int2x3 operator /(Int2x3 left, Int2x3 right) => throw new InvalidExecutionContextException($"{nameof(Int2x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int2x3 operator *(Int2x3 left, Int2x3 right) => throw new InvalidExecutionContextException($"{nameof(Int2x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int2x3 operator -(Int2x3 left, Int2x3 right) => throw new InvalidExecutionContextException($"{nameof(Int2x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct Int2x4 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + [FieldOffset(16)] + private int m21; + + [FieldOffset(20)] + private int m22; + + [FieldOffset(24)] + private int m23; + + [FieldOffset(28)] + private int m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public Int2x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public Int2x4(Int4 row1, Int4 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int2x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref int M14 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref int M23 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref int M24 => throw new InvalidExecutionContextException($"{typeof(Int2x4)}.M24"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int2x4(int x) + { + Int2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int2x4 operator -(Int2x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Int2x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int2x4 operator +(Int2x4 left, Int2x4 right) => throw new InvalidExecutionContextException($"{nameof(Int2x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int2x4 operator /(Int2x4 left, Int2x4 right) => throw new InvalidExecutionContextException($"{nameof(Int2x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int2x4 operator *(Int2x4 left, Int2x4 right) => throw new InvalidExecutionContextException($"{nameof(Int2x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int2x4 operator -(Int2x4 left, Int2x4 right) => throw new InvalidExecutionContextException($"{nameof(Int2x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct Int3x1 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m21; + + [FieldOffset(8)] + private int m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public Int3x1(int m11, int m21, int m31) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref int this[int row] => throw new InvalidExecutionContextException($"{nameof(Int3x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int3x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int3x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int3x1)}.M31"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int3x1(int x) + { + Int3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int3x1 operator -(Int3x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Int3x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int3x1 operator +(Int3x1 left, Int3x1 right) => throw new InvalidExecutionContextException($"{nameof(Int3x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int3x1 operator /(Int3x1 left, Int3x1 right) => throw new InvalidExecutionContextException($"{nameof(Int3x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int3x1 operator *(Int3x1 left, Int3x1 right) => throw new InvalidExecutionContextException($"{nameof(Int3x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int3x1 operator -(Int3x1 left, Int3x1 right) => throw new InvalidExecutionContextException($"{nameof(Int3x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int3(Int3x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Int3x1)}.{nameof(Int3)}({nameof(Int3x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct Int3x2 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m21; + + [FieldOffset(12)] + private int m22; + + [FieldOffset(16)] + private int m31; + + [FieldOffset(20)] + private int m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public Int3x2(int m11, int m12, int m21, int m22, int m31, int m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Int3x2(Int2 row1, Int2 row2, Int2 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int3x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int3x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int3x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int3x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int3x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int3x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref int M32 => throw new InvalidExecutionContextException($"{typeof(Int3x2)}.M32"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int3x2(int x) + { + Int3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int3x2 operator -(Int3x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Int3x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int3x2 operator +(Int3x2 left, Int3x2 right) => throw new InvalidExecutionContextException($"{nameof(Int3x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int3x2 operator /(Int3x2 left, Int3x2 right) => throw new InvalidExecutionContextException($"{nameof(Int3x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int3x2 operator *(Int3x2 left, Int3x2 right) => throw new InvalidExecutionContextException($"{nameof(Int3x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int3x2 operator -(Int3x2 left, Int3x2 right) => throw new InvalidExecutionContextException($"{nameof(Int3x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] + public partial struct Int3x3 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m21; + + [FieldOffset(16)] + private int m22; + + [FieldOffset(20)] + private int m23; + + [FieldOffset(24)] + private int m31; + + [FieldOffset(28)] + private int m32; + + [FieldOffset(32)] + private int m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public Int3x3(int m11, int m12, int m13, int m21, int m22, int m23, int m31, int m32, int m33) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Int3x3(Int3 row1, Int3 row2, Int3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int3x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref int M23 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref int M32 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref int M33 => throw new InvalidExecutionContextException($"{typeof(Int3x3)}.M33"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int3x3(int x) + { + Int3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int3x3 operator -(Int3x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Int3x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int3x3 operator +(Int3x3 left, Int3x3 right) => throw new InvalidExecutionContextException($"{nameof(Int3x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int3x3 operator /(Int3x3 left, Int3x3 right) => throw new InvalidExecutionContextException($"{nameof(Int3x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int3x3 operator *(Int3x3 left, Int3x3 right) => throw new InvalidExecutionContextException($"{nameof(Int3x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int3x3 operator -(Int3x3 left, Int3x3 right) => throw new InvalidExecutionContextException($"{nameof(Int3x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct Int3x4 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + [FieldOffset(16)] + private int m21; + + [FieldOffset(20)] + private int m22; + + [FieldOffset(24)] + private int m23; + + [FieldOffset(28)] + private int m24; + + [FieldOffset(32)] + private int m31; + + [FieldOffset(36)] + private int m32; + + [FieldOffset(40)] + private int m33; + + [FieldOffset(44)] + private int m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public Int3x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24, int m31, int m32, int m33, int m34) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public Int3x4(Int4 row1, Int4 row2, Int4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int3x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref int M14 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref int M23 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref int M24 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref int M32 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref int M33 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref int M34 => throw new InvalidExecutionContextException($"{typeof(Int3x4)}.M34"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int3x4(int x) + { + Int3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int3x4 operator -(Int3x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Int3x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int3x4 operator +(Int3x4 left, Int3x4 right) => throw new InvalidExecutionContextException($"{nameof(Int3x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int3x4 operator /(Int3x4 left, Int3x4 right) => throw new InvalidExecutionContextException($"{nameof(Int3x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int3x4 operator *(Int3x4 left, Int3x4 right) => throw new InvalidExecutionContextException($"{nameof(Int3x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int3x4 operator -(Int3x4 left, Int3x4 right) => throw new InvalidExecutionContextException($"{nameof(Int3x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct Int4x1 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m21; + + [FieldOffset(8)] + private int m31; + + [FieldOffset(12)] + private int m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public Int4x1(int m11, int m21, int m31, int m41) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref int this[int row] => throw new InvalidExecutionContextException($"{nameof(Int4x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int4x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int4x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int4x1)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref int M41 => throw new InvalidExecutionContextException($"{typeof(Int4x1)}.M41"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int4x1(int x) + { + Int4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int4x1 operator -(Int4x1 matrix) => throw new InvalidExecutionContextException($"{nameof(Int4x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int4x1 operator +(Int4x1 left, Int4x1 right) => throw new InvalidExecutionContextException($"{nameof(Int4x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int4x1 operator /(Int4x1 left, Int4x1 right) => throw new InvalidExecutionContextException($"{nameof(Int4x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int4x1 operator *(Int4x1 left, Int4x1 right) => throw new InvalidExecutionContextException($"{nameof(Int4x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int4x1 operator -(Int4x1 left, Int4x1 right) => throw new InvalidExecutionContextException($"{nameof(Int4x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Int4(Int4x1 matrix) => throw new InvalidExecutionContextException($"{typeof(Int4x1)}.{nameof(Int4)}({nameof(Int4x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct Int4x2 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m21; + + [FieldOffset(12)] + private int m22; + + [FieldOffset(16)] + private int m31; + + [FieldOffset(20)] + private int m32; + + [FieldOffset(24)] + private int m41; + + [FieldOffset(28)] + private int m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public Int4x2(int m11, int m12, int m21, int m22, int m31, int m32, int m41, int m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Int4x2(Int2 row1, Int2 row2, Int2 row3, Int2 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int2 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int4x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref int M32 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref int M41 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref int M42 => throw new InvalidExecutionContextException($"{typeof(Int4x2)}.M42"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int4x2(int x) + { + Int4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int4x2 operator -(Int4x2 matrix) => throw new InvalidExecutionContextException($"{nameof(Int4x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int4x2 operator +(Int4x2 left, Int4x2 right) => throw new InvalidExecutionContextException($"{nameof(Int4x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int4x2 operator /(Int4x2 left, Int4x2 right) => throw new InvalidExecutionContextException($"{nameof(Int4x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int4x2 operator *(Int4x2 left, Int4x2 right) => throw new InvalidExecutionContextException($"{nameof(Int4x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int4x2 operator -(Int4x2 left, Int4x2 right) => throw new InvalidExecutionContextException($"{nameof(Int4x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct Int4x3 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m21; + + [FieldOffset(16)] + private int m22; + + [FieldOffset(20)] + private int m23; + + [FieldOffset(24)] + private int m31; + + [FieldOffset(28)] + private int m32; + + [FieldOffset(32)] + private int m33; + + [FieldOffset(36)] + private int m41; + + [FieldOffset(40)] + private int m42; + + [FieldOffset(44)] + private int m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public Int4x3(int m11, int m12, int m13, int m21, int m22, int m23, int m31, int m32, int m33, int m41, int m42, int m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Int4x3(Int3 row1, Int3 row2, Int3 row3, Int3 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int3 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int4x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref int M23 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref int M32 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref int M33 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref int M41 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref int M42 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref int M43 => throw new InvalidExecutionContextException($"{typeof(Int4x3)}.M43"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int4x3(int x) + { + Int4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int4x3 operator -(Int4x3 matrix) => throw new InvalidExecutionContextException($"{nameof(Int4x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int4x3 operator +(Int4x3 left, Int4x3 right) => throw new InvalidExecutionContextException($"{nameof(Int4x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int4x3 operator /(Int4x3 left, Int4x3 right) => throw new InvalidExecutionContextException($"{nameof(Int4x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int4x3 operator *(Int4x3 left, Int4x3 right) => throw new InvalidExecutionContextException($"{nameof(Int4x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int4x3 operator -(Int4x3 left, Int4x3 right) => throw new InvalidExecutionContextException($"{nameof(Int4x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] + public partial struct Int4x4 + { + [FieldOffset(0)] + private int m11; + + [FieldOffset(4)] + private int m12; + + [FieldOffset(8)] + private int m13; + + [FieldOffset(12)] + private int m14; + + [FieldOffset(16)] + private int m21; + + [FieldOffset(20)] + private int m22; + + [FieldOffset(24)] + private int m23; + + [FieldOffset(28)] + private int m24; + + [FieldOffset(32)] + private int m31; + + [FieldOffset(36)] + private int m32; + + [FieldOffset(40)] + private int m33; + + [FieldOffset(44)] + private int m34; + + [FieldOffset(48)] + private int m41; + + [FieldOffset(52)] + private int m42; + + [FieldOffset(56)] + private int m43; + + [FieldOffset(60)] + private int m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public Int4x4(int m11, int m12, int m13, int m14, int m21, int m22, int m23, int m24, int m31, int m32, int m33, int m34, int m41, int m42, int m43, int m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public Int4x4(Int4 row1, Int4 row2, Int4 row3, Int4 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref Int4 this[int row] => throw new InvalidExecutionContextException($"{nameof(Int4x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref Int2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(Int4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref Int3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(Int4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref Int4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(Int4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref int M11 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref int M12 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref int M13 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref int M14 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref int M21 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref int M22 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref int M23 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref int M24 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref int M31 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref int M32 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref int M33 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref int M34 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M34"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref int M41 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref int M42 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref int M43 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M43"); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public ref int M44 => throw new InvalidExecutionContextException($"{typeof(Int4x4)}.M44"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator Int4x4(int x) + { + Int4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static Int4x4 operator -(Int4x4 matrix) => throw new InvalidExecutionContextException($"{nameof(Int4x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static Int4x4 operator +(Int4x4 left, Int4x4 right) => throw new InvalidExecutionContextException($"{nameof(Int4x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static Int4x4 operator /(Int4x4 left, Int4x4 right) => throw new InvalidExecutionContextException($"{nameof(Int4x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static Int4x4 operator *(Int4x4 left, Int4x4 right) => throw new InvalidExecutionContextException($"{nameof(Int4x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static Int4x4 operator -(Int4x4 left, Int4x4 right) => throw new InvalidExecutionContextException($"{nameof(Int4x4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/Int/IntMxN.tt b/src/ComputeSharp/Core/Primitives/Int/IntMxN.tt new file mode 100644 index 00000000..bf70cf4d --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/Int/IntMxN.tt @@ -0,0 +1,4 @@ +<#@include file="..\MatrixType.ttinclude" #> +<# +GenerateAllMatrixProperties("Int", sizeof(int)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/MatrixIndex.cs b/src/ComputeSharp/Core/Primitives/MatrixIndex.cs new file mode 100644 index 00000000..5b330472 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/MatrixIndex.cs @@ -0,0 +1,97 @@ +namespace ComputeSharp +{ + /// + /// A type indicating a base-1 index into a matrix type. This can be used to extract references to swizzled vectors within a given matrix value. + /// For more info, see . + /// This type is meant to be used within a directive to simplify the code: + /// + /// + /// using static ComputeSharp.MatrixIndex; + /// Float2x2 matrix = 0; + /// Float2 row = matrix[M11, M12]; + /// + /// + /// + public enum MatrixIndex + { + /// + /// The first item in the first row. + /// + M11, + + /// + /// The second item in the first row. + /// + M12, + + /// + /// The third item in the first row. + /// + M13, + + /// + /// The fourth item in the first row. + /// + M14, + + /// + /// The first item in the second row. + /// + M21, + + /// + /// The second item in the second row. + /// + M22, + + /// + /// The third item in the second row. + /// + M23, + + /// + /// The fourth item in the second row. + /// + M24, + + /// + /// The first item in the third row. + /// + M31, + + /// + /// The second item in the third row. + /// + M32, + + /// + /// The third item in the third row. + /// + M33, + + /// + /// The fourth item in the third row. + /// + M34, + + /// + /// The first item in the fourth row. + /// + M41, + + /// + /// The second item in the fourth row. + /// + M42, + + /// + /// The third item in the fourth row. + /// + M43, + + /// + /// The fourth item in the fourth row. + /// + M44 + } +} diff --git a/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude b/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude new file mode 100644 index 00000000..9ef58902 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/MatrixType.ttinclude @@ -0,0 +1,268 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Text.RegularExpressions" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".g.cs"#> +<# +// Generates all matrix members and types for a given HLSL type +void GenerateAllMatrixProperties(string typeName, int elementSize) +{ +#> +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ +<# + for (int rows = 1; rows <= 4; rows++) + for (int columns = 1; columns <= 4; columns++) + { + if (rows > 1 || columns > 1) WriteLine(""); + + GenerateMatrixProperties(typeName, rows, columns, elementSize); + } +#> +} +<# +} + +// Generates all vector access properties for a specified type +void GenerateMatrixProperties(string typeName, int rows, int columns, int elementSize) +{ + string elementTypeName = typeName.ToLower(); + string fullTypeName = $"{typeName}{rows}x{columns}"; + string rowTypeName = columns > 1 ? $"{typeName}{columns}" : elementTypeName; + List fieldNames = new List(); +#> + /// + [StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * rows * columns)#>, Pack = <#=elementSize#>)] + public partial struct <#=fullTypeName#> + { +<# + PushIndent(" "); + PushIndent(" "); + + // Generate the private fields + for (int i = 1; i <= rows; i++) + for (int j = 1; j <= columns; j++) + { + WriteLine($"[FieldOffset({((i - 1) * columns + j - 1) * elementSize})]"); + WriteLine($"private {elementTypeName} m{i}{j};"); + WriteLine(""); + + fieldNames.Add($"m{i}{j}"); + } + + // Generate the elementwise constructor + WriteLine("/// "); + WriteLine($"/// Creates a new instance with the specified parameters."); + WriteLine("/// "); + + for (int i = 1; i <= rows; i++) + for (int j = 1; j <= columns; j++) + { + WriteLine($"/// The value to assign to the component at position [{i}, {j}]."); + } + + WriteLine($"public {fullTypeName}({string.Join(", ", fieldNames.Select(n => $"{elementTypeName} {n}"))})"); + WriteLine("{"); + PushIndent(" "); + + foreach (string fieldName in fieldNames) + { + WriteLine($"this.{fieldName} = {fieldName};"); + } + + PopIndent(); + WriteLine("}"); + WriteLine(""); + + // Generate the row-wise constructor, if needed + if (rows > 1 && columns > 1) + { + WriteLine("/// "); + WriteLine($"/// Creates a new instance with the specified parameters."); + WriteLine("/// "); + + for (int i = 1; i <= rows; i++) + { + WriteLine($"/// The value to assign to the row at position [{i}]."); + } + + Write($"public {fullTypeName}("); + + for (int i = 1; i <= rows; i++) + { + if (i > 1) Write(", "); + Write($"{rowTypeName} row{i}"); + } + + WriteLine(")"); + WriteLine("{"); + PushIndent(" "); + + for (int i = 1; i <= rows; i++) + for (int j = 1; j <= columns; j++) + { + WriteLine($"this.m{i}{j} = row{i}.{"XYZW"[j - 1]};"); + } + + PopIndent(); + WriteLine("}"); + WriteLine(""); + } + + PopIndent(); + PopIndent(); +#> + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref <#=rowTypeName#> this[int row] => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref <#=typeName#>2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref <#=typeName#>3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref <#=typeName#>4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); +<# + for (int i = 1; i <= rows; i++) + for (int j = 1; j <= columns; j++) + { + WriteLine(""); +#> + /// + /// Gets a reference to the value representing the component at position [<#=i#>, <#=j#>]. + /// + public ref <#=elementTypeName#> M<#=i#><#=j#> => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.M<#=i#><#=j#>"); +<# + } + + WriteLine(""); +#> + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator <#=fullTypeName#>(<#=elementTypeName#> x) +<# + // Complete the conversion operator above + PushIndent(" "); + PushIndent(" "); + WriteLine("{"); + PushIndent(" "); + WriteLine($"{fullTypeName} matrix;"); + WriteLine(""); + + for (int i = 1; i <= rows; i++) + for (int j = 1; j <= columns; j++) + { + WriteLine($"matrix.m{i}{j} = x;"); + } + + WriteLine(""); + WriteLine("return matrix;"); + + PopIndent(); + WriteLine("}"); + PopIndent(); + PopIndent(); + + // Generate the negation operator + if (elementTypeName != "Bool" && elementTypeName != "UInt") + { + WriteLine(""); +#> + /// + /// Negates a value. + /// + /// The value to negate. + public static <#=fullTypeName#> operator -(<#=fullTypeName#> matrix) => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}.-"); +<# + } + + // Generate the numerical operators + if (elementTypeName != "Bool") + { + WriteLine(""); +#> + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static <#=fullTypeName#> operator +(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static <#=fullTypeName#> operator /(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static <#=fullTypeName#> operator *(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static <#=fullTypeName#> operator -(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=fullTypeName#>)}.-"); +<# + } + + // Generate the casting operators for row/column vectors + if (rows == 1 && columns > 1) + { + WriteLine(""); +#> + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator <#=fullTypeName#>(<#=typeName#><#=columns#> vector) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.{nameof(<#=fullTypeName#>)}({nameof(<#=typeName#><#=columns#>)})"); +<# + } + + if (columns == 1 && rows > 1) + { + WriteLine(""); +#> + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator <#=typeName#><#=rows#>(<#=fullTypeName#> matrix) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.{nameof(<#=typeName#><#=rows#>)}({nameof(<#=fullTypeName#>)})"); +<# + } +#> + } +<# +} +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs new file mode 100644 index 00000000..54c8d69a --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt2.cs @@ -0,0 +1,67 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y})")] + public partial struct UInt2 + { + /// + /// Gets an value with all components set to 0. + /// + public static UInt2 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static UInt2 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt2 UnitX => new(1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt2 UnitY => new(0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + public UInt2(uint x, uint y) + { + this.x = x; + this.y = y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt2(uint x) => new(x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int2(UInt2 xy) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.({nameof(Int2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float2(UInt2 xy) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.({nameof(Float2)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double2(UInt2 xy) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.({nameof(Double2)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs new file mode 100644 index 00000000..8c539699 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt2.g.cs @@ -0,0 +1,250 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct UInt2 + { + [FieldOffset(0)] + private uint x; + + [FieldOffset(4)] + private uint y; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref uint this[int i] => throw new InvalidExecutionContextException($"{nameof(UInt2)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref uint X => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref uint Y => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref uint Z => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref uint W => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 XX => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XY => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XZ => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XW => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YX => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 YY => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YZ => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YW => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZX => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZY => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 ZZ => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZW => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WX => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WY => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WZ => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 WW => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(WW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref uint R => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref uint G => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref uint B => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref uint A => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 RR => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RG => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RB => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RA => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GR => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 GG => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GB => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GA => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BR => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BG => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 BB => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BA => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AR => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AG => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AB => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 AA => throw new InvalidExecutionContextException($"{nameof(UInt2)}.{nameof(AA)}"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt2 operator +(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static UInt2 operator /(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt2 operator *(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt2 operator -(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt2.tt b/src/ComputeSharp/Core/Primitives/UInt/UInt2.tt new file mode 100644 index 00000000..0b505c6e --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt2.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("UInt2", sizeof(uint)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs new file mode 100644 index 00000000..a0cbfa7b --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt3.cs @@ -0,0 +1,98 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z})")] + public partial struct UInt3 + { + /// + /// Gets an value with all components set to 0. + /// + public static UInt3 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static UInt3 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitX => new(1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitY => new(0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt3 UnitZ => new(0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + public UInt3(uint x, uint y, uint z) + { + this.x = x; + this.y = y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + public UInt3(UInt2 xy, uint z) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second and thirt vector components. + public UInt3(uint x, UInt2 yz) + { + this.x = x; + this.y = yz.X; + this.z = yz.Y; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt3(uint x) => new(x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int3(UInt3 xyz) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.({nameof(Int3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float3(UInt3 xyz) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.({nameof(Float3)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double3(UInt3 xyz) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.({nameof(Double3)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs new file mode 100644 index 00000000..51d07dd9 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt3.g.cs @@ -0,0 +1,893 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct UInt3 + { + [FieldOffset(0)] + private uint x; + + [FieldOffset(4)] + private uint y; + + [FieldOffset(8)] + private uint z; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref uint this[int i] => throw new InvalidExecutionContextException($"{nameof(UInt3)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref uint X => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref uint Y => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref uint Z => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref uint W => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 XX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 YY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 ZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 WW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XYX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XYY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XYZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XYW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XZX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XZY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XZW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XWX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XWY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XWZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XWW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YXX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YXY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YXZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YXW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YZX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YZY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YZW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YWX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YWY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YWZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YWW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZXX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZXY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZXZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZXW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZYX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZYY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZYZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZYW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZWX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZWY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZWZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZWW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WXX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WXY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WXZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WXW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WYX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WYY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WYZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WYW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WZX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WZY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WZZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WZW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWX => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWY => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWZ => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWW => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(WWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref uint R => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref uint G => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref uint B => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref uint A => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 RR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 GG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 BB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 AA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RGR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RGG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RGB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RGA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RBR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RBG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RBB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RBA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RAR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RAG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RAB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RAA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GRR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GRG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GRB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GRA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GBR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GBG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GBB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GBA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GAR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GAG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GAB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GAA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BRR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BRG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BRB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BRA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BGR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BGG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BGB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BGA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BAR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BAG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BAB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BAA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ARR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ARG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ARB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ARA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 AGR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AGG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 AGB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AGA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ABR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ABG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ABB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ABA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAR => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAG => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAB => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAA => throw new InvalidExecutionContextException($"{nameof(UInt3)}.{nameof(AAA)}"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt3 operator +(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static UInt3 operator /(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt3 operator *(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt3 operator -(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt3.tt b/src/ComputeSharp/Core/Primitives/UInt/UInt3.tt new file mode 100644 index 00000000..eac79629 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt3.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("UInt3", sizeof(uint)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs new file mode 100644 index 00000000..453c9495 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt4.cs @@ -0,0 +1,148 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + /// A that maps the HLSL type. + /// + [DebuggerDisplay("({X}, {Y}, {Z}, {W})")] + public partial struct UInt4 + { + /// + /// Gets an value with all components set to 0. + /// + public static UInt4 Zero => 0; + + /// + /// Gets an value with all components set to 1. + /// + public static UInt4 One => 1; + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitX => new(1, 0, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitY => new(0, 1, 0, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitZ => new(0, 0, 1, 0); + + /// + /// Gets an value with the component set to 1, and the others to 0. + /// + public static UInt4 UnitW => new(0, 0, 0, 1); + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public UInt4(uint x, uint y, uint z, uint w) + { + this.x = x; + this.y = y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third vector component. + /// The value to assign to the fourth vector component. + public UInt4(UInt2 xy, uint z, uint w) + { + this.x = xy.X; + this.y = xy.Y; + this.z = z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second vector component. + /// The value to assign to the third and fourth vector components. + public UInt4(uint x, uint y, UInt2 zw) + { + this.x = x; + this.y = y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first and second vector components. + /// The value to assign to the third and fourth vector components. + public UInt4(UInt2 xy, UInt2 zw) + { + this.x = xy.X; + this.y = xy.Y; + this.z = zw.X; + this.w = zw.Y; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first, second and third vector components. + /// The value to assign to the fourth vector component. + public UInt4(UInt3 xyz, uint w) + { + this.x = xyz.X; + this.y = xyz.Y; + this.z = xyz.Z; + this.w = w; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the first vector component. + /// The value to assign to the second, third and fourth vector components. + public UInt4(uint x, UInt3 yzw) + { + this.x = x; + this.y = yzw.X; + this.z = yzw.Y; + this.w = yzw.Z; + } + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt4(uint x) => new(x, x, x, x); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static explicit operator Int4(UInt4 xyzw) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.({nameof(Int4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Float4(UInt4 xyzw) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.({nameof(Float4)})"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator Double4(UInt4 xyzw) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.({nameof(Double4)})"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs new file mode 100644 index 00000000..4404bb94 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt4.g.cs @@ -0,0 +1,3456 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct UInt4 + { + [FieldOffset(0)] + private uint x; + + [FieldOffset(4)] + private uint y; + + [FieldOffset(8)] + private uint z; + + [FieldOffset(12)] + private uint w; + + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref uint this[int i] => throw new InvalidExecutionContextException($"{nameof(UInt4)}[int]"); + + /// + /// Gets a reference to the value representing the X component. + /// + public ref uint X => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(X)}"); + + /// + /// Gets a reference to the value representing the Y component. + /// + public ref uint Y => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(Y)}"); + + /// + /// Gets a reference to the value representing the Z component. + /// + public ref uint Z => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(Z)}"); + + /// + /// Gets a reference to the value representing the W component. + /// + public ref uint W => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(W)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 XX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 XW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YX)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 YY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 YW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZY)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 ZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZ)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 ZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZW)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WX)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WY)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 WZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZ)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 WW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 XWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 XWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 YWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 YWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZ)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYY)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYW)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZX)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 WZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 WWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 XYZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 XYWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 XZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 XZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 XWYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 XWZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 XWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(XWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 YXZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 YXWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 YZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 YZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 YWXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 YWZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 YWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(YWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ZXYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ZXWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXZ)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ZYXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYZW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ZYWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ZWXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ZWYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ZWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ZWWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 WXYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 WXZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WXWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WXWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXY)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 WYXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYYW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 WYZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WYWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WYWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXX)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 WZXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZXW)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 WZYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WZWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WZWW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWXX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWXY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWXZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWXW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWXW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWYX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWYY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWYZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWYW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWYW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWZX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWZY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWZZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWZW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWZW)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWWX => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWX)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWWY => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWY)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWWZ => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWZ)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 WWWW => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(WWWW)}"); + + /// + /// Gets a reference to the value representing the R component. + /// + public ref uint R => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(R)}"); + + /// + /// Gets a reference to the value representing the G component. + /// + public ref uint G => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(G)}"); + + /// + /// Gets a reference to the value representing the B component. + /// + public ref uint B => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(B)}"); + + /// + /// Gets a reference to the value representing the A component. + /// + public ref uint A => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(A)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 RR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 RA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GR)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 GG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 GA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BG)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 BB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BB)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 BA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BA)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AR)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AG)}"); + + /// + /// Gets a reference to the value with the components , . + /// + public ref UInt2 AB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AB)}"); + + /// + /// Gets a readonly reference to the value with the components , . + /// + public ref readonly UInt2 AA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 RAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 RAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 GAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 GAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGB)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 BAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 BAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 AGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGG)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 AGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGA)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABR)}"); + + /// + /// Gets a reference to the value with the components , , . + /// + public ref UInt3 ABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 ABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , . + /// + public ref readonly UInt3 AAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RRAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 RGBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 RGAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 RBGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 RBAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RBAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RAGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 RAGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 RABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 RAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(RAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 GRBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 GRAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GRAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 GBRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 GBAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GBAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 GARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 GABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 GAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(GAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 BRGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 BRAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BRAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BRAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRB)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 BGRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGBA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 BGAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BBAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BBAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 BARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BARA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 BAGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BAGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 BAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(BAAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ARGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ARBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ARAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ARAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRG)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 AGRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGRA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGGA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 AGBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AGAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AGAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABRR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRR)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ABRG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABRB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABRA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABRA)}"); + + /// + /// Gets a reference to the value with the components , , , . + /// + public ref UInt4 ABGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABBR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABBG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABBB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABBA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABBA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 ABAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(ABAA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AARR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AARG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AARB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AARA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AARA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAGR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAGG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAGB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAGA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAGA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AABR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AABG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AABB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AABA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AABA)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAAR => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAR)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAAG => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAG)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAAB => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAB)}"); + + /// + /// Gets a readonly reference to the value with the components , , , . + /// + public ref readonly UInt4 AAAA => throw new InvalidExecutionContextException($"{nameof(UInt4)}.{nameof(AAAA)}"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt4 operator +(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static UInt4 operator /(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt4 operator *(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt4 operator -(UInt4 left, UInt4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/UInt/UInt4.tt b/src/ComputeSharp/Core/Primitives/UInt/UInt4.tt new file mode 100644 index 00000000..ccbf0ae8 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UInt4.tt @@ -0,0 +1,4 @@ +<#@include file="..\VectorType.ttinclude" #> +<# +GenerateVectorProperties("UInt4", sizeof(uint)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs new file mode 100644 index 00000000..c2bb30a2 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.g.cs @@ -0,0 +1,2720 @@ +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 4)] + public partial struct UInt1x1 + { + [FieldOffset(0)] + private uint m11; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + public UInt1x1(uint m11) + { + this.m11 = m11; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref uint this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt1x1)}.M11"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt1x1(uint x) + { + UInt1x1 matrix; + + matrix.m11 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt1x1 operator -(UInt1x1 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt1x1 operator +(UInt1x1 left, UInt1x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt1x1 operator /(UInt1x1 left, UInt1x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt1x1 operator *(UInt1x1 left, UInt1x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt1x1 operator -(UInt1x1 left, UInt1x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x1)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct UInt1x2 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + public UInt1x2(uint m11, uint m12) + { + this.m11 = m11; + this.m12 = m12; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt2 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt1x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt1x2)}.M12"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt1x2(uint x) + { + UInt1x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt1x2 operator -(UInt1x2 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt1x2 operator +(UInt1x2 left, UInt1x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt1x2 operator /(UInt1x2 left, UInt1x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt1x2 operator *(UInt1x2 left, UInt1x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt1x2 operator -(UInt1x2 left, UInt1x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x2)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt1x2(UInt2 vector) => throw new InvalidExecutionContextException($"{typeof(UInt1x2)}.{nameof(UInt1x2)}({nameof(UInt2)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct UInt1x3 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + public UInt1x3(uint m11, uint m12, uint m13) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt3 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt1x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt1x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt1x3)}.M13"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt1x3(uint x) + { + UInt1x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt1x3 operator -(UInt1x3 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt1x3 operator +(UInt1x3 left, UInt1x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt1x3 operator /(UInt1x3 left, UInt1x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt1x3 operator *(UInt1x3 left, UInt1x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt1x3 operator -(UInt1x3 left, UInt1x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x3)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt1x3(UInt3 vector) => throw new InvalidExecutionContextException($"{typeof(UInt1x3)}.{nameof(UInt1x3)}({nameof(UInt3)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct UInt1x4 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + public UInt1x4(uint m11, uint m12, uint m13, uint m14) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt4 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt1x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt1x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt1x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref uint M14 => throw new InvalidExecutionContextException($"{typeof(UInt1x4)}.M14"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt1x4(uint x) + { + UInt1x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt1x4 operator -(UInt1x4 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt1x4 operator +(UInt1x4 left, UInt1x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt1x4 operator /(UInt1x4 left, UInt1x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt1x4 operator *(UInt1x4 left, UInt1x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt1x4 operator -(UInt1x4 left, UInt1x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt1x4)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt1x4(UInt4 vector) => throw new InvalidExecutionContextException($"{typeof(UInt1x4)}.{nameof(UInt1x4)}({nameof(UInt4)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)] + public partial struct UInt2x1 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m21; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + public UInt2x1(uint m11, uint m21) + { + this.m11 = m11; + this.m21 = m21; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref uint this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt2x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt2x1)}.M21"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt2x1(uint x) + { + UInt2x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt2x1 operator -(UInt2x1 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt2x1 operator +(UInt2x1 left, UInt2x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt2x1 operator /(UInt2x1 left, UInt2x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt2x1 operator *(UInt2x1 left, UInt2x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt2x1 operator -(UInt2x1 left, UInt2x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt2(UInt2x1 matrix) => throw new InvalidExecutionContextException($"{typeof(UInt2x1)}.{nameof(UInt2)}({nameof(UInt2x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct UInt2x2 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m21; + + [FieldOffset(12)] + private uint m22; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + public UInt2x2(uint m11, uint m12, uint m21, uint m22) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public UInt2x2(UInt2 row1, UInt2 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt2 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt2x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt2x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt2x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt2x2)}.M22"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt2x2(uint x) + { + UInt2x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt2x2 operator -(UInt2x2 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt2x2 operator +(UInt2x2 left, UInt2x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt2x2 operator /(UInt2x2 left, UInt2x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt2x2 operator *(UInt2x2 left, UInt2x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt2x2 operator -(UInt2x2 left, UInt2x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct UInt2x3 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m21; + + [FieldOffset(16)] + private uint m22; + + [FieldOffset(20)] + private uint m23; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + public UInt2x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public UInt2x3(UInt3 row1, UInt3 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt3 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt2x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt2x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt2x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt2x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt2x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref uint M23 => throw new InvalidExecutionContextException($"{typeof(UInt2x3)}.M23"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt2x3(uint x) + { + UInt2x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt2x3 operator -(UInt2x3 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt2x3 operator +(UInt2x3 left, UInt2x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt2x3 operator /(UInt2x3 left, UInt2x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt2x3 operator *(UInt2x3 left, UInt2x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt2x3 operator -(UInt2x3 left, UInt2x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct UInt2x4 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + [FieldOffset(16)] + private uint m21; + + [FieldOffset(20)] + private uint m22; + + [FieldOffset(24)] + private uint m23; + + [FieldOffset(28)] + private uint m24; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + public UInt2x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + public UInt2x4(UInt4 row1, UInt4 row2) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt4 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref uint M14 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref uint M23 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref uint M24 => throw new InvalidExecutionContextException($"{typeof(UInt2x4)}.M24"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt2x4(uint x) + { + UInt2x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt2x4 operator -(UInt2x4 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt2x4 operator +(UInt2x4 left, UInt2x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt2x4 operator /(UInt2x4 left, UInt2x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt2x4 operator *(UInt2x4 left, UInt2x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt2x4 operator -(UInt2x4 left, UInt2x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt2x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)] + public partial struct UInt3x1 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m21; + + [FieldOffset(8)] + private uint m31; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + public UInt3x1(uint m11, uint m21, uint m31) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref uint this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt3x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt3x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt3x1)}.M31"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt3x1(uint x) + { + UInt3x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt3x1 operator -(UInt3x1 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt3x1 operator +(UInt3x1 left, UInt3x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt3x1 operator /(UInt3x1 left, UInt3x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt3x1 operator *(UInt3x1 left, UInt3x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt3x1 operator -(UInt3x1 left, UInt3x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt3(UInt3x1 matrix) => throw new InvalidExecutionContextException($"{typeof(UInt3x1)}.{nameof(UInt3)}({nameof(UInt3x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 24, Pack = 4)] + public partial struct UInt3x2 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m21; + + [FieldOffset(12)] + private uint m22; + + [FieldOffset(16)] + private uint m31; + + [FieldOffset(20)] + private uint m32; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + public UInt3x2(uint m11, uint m12, uint m21, uint m22, uint m31, uint m32) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public UInt3x2(UInt2 row1, UInt2 row2, UInt2 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt2 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt3x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt3x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt3x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt3x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt3x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref uint M32 => throw new InvalidExecutionContextException($"{typeof(UInt3x2)}.M32"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt3x2(uint x) + { + UInt3x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt3x2 operator -(UInt3x2 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt3x2 operator +(UInt3x2 left, UInt3x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt3x2 operator /(UInt3x2 left, UInt3x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt3x2 operator *(UInt3x2 left, UInt3x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt3x2 operator -(UInt3x2 left, UInt3x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 36, Pack = 4)] + public partial struct UInt3x3 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m21; + + [FieldOffset(16)] + private uint m22; + + [FieldOffset(20)] + private uint m23; + + [FieldOffset(24)] + private uint m31; + + [FieldOffset(28)] + private uint m32; + + [FieldOffset(32)] + private uint m33; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + public UInt3x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23, uint m31, uint m32, uint m33) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public UInt3x3(UInt3 row1, UInt3 row2, UInt3 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt3 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref uint M23 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref uint M32 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref uint M33 => throw new InvalidExecutionContextException($"{typeof(UInt3x3)}.M33"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt3x3(uint x) + { + UInt3x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt3x3 operator -(UInt3x3 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt3x3 operator +(UInt3x3 left, UInt3x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt3x3 operator /(UInt3x3 left, UInt3x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt3x3 operator *(UInt3x3 left, UInt3x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt3x3 operator -(UInt3x3 left, UInt3x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct UInt3x4 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + [FieldOffset(16)] + private uint m21; + + [FieldOffset(20)] + private uint m22; + + [FieldOffset(24)] + private uint m23; + + [FieldOffset(28)] + private uint m24; + + [FieldOffset(32)] + private uint m31; + + [FieldOffset(36)] + private uint m32; + + [FieldOffset(40)] + private uint m33; + + [FieldOffset(44)] + private uint m34; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + public UInt3x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24, uint m31, uint m32, uint m33, uint m34) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + public UInt3x4(UInt4 row1, UInt4 row2, UInt4 row3) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt4 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref uint M14 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref uint M23 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref uint M24 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref uint M32 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref uint M33 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref uint M34 => throw new InvalidExecutionContextException($"{typeof(UInt3x4)}.M34"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt3x4(uint x) + { + UInt3x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt3x4 operator -(UInt3x4 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt3x4 operator +(UInt3x4 left, UInt3x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt3x4 operator /(UInt3x4 left, UInt3x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt3x4 operator *(UInt3x4 left, UInt3x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt3x4 operator -(UInt3x4 left, UInt3x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt3x4)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 4)] + public partial struct UInt4x1 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m21; + + [FieldOffset(8)] + private uint m31; + + [FieldOffset(12)] + private uint m41; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [4, 1]. + public UInt4x1(uint m11, uint m21, uint m31, uint m41) + { + this.m11 = m11; + this.m21 = m21; + this.m31 = m31; + this.m41 = m41; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref uint this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt4x1)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt4x1)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt4x1)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref uint M41 => throw new InvalidExecutionContextException($"{typeof(UInt4x1)}.M41"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt4x1(uint x) + { + UInt4x1 matrix; + + matrix.m11 = x; + matrix.m21 = x; + matrix.m31 = x; + matrix.m41 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt4x1 operator -(UInt4x1 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt4x1 operator +(UInt4x1 left, UInt4x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt4x1 operator /(UInt4x1 left, UInt4x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt4x1 operator *(UInt4x1 left, UInt4x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt4x1 operator -(UInt4x1 left, UInt4x1 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x1)}.-"); + + /// + /// Casts a value to a one. + /// + /// The input value to cast. + public static implicit operator UInt4(UInt4x1 matrix) => throw new InvalidExecutionContextException($"{typeof(UInt4x1)}.{nameof(UInt4)}({nameof(UInt4x1)})"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 32, Pack = 4)] + public partial struct UInt4x2 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m21; + + [FieldOffset(12)] + private uint m22; + + [FieldOffset(16)] + private uint m31; + + [FieldOffset(20)] + private uint m32; + + [FieldOffset(24)] + private uint m41; + + [FieldOffset(28)] + private uint m42; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + public UInt4x2(uint m11, uint m12, uint m21, uint m22, uint m31, uint m32, uint m41, uint m42) + { + this.m11 = m11; + this.m12 = m12; + this.m21 = m21; + this.m22 = m22; + this.m31 = m31; + this.m32 = m32; + this.m41 = m41; + this.m42 = m42; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public UInt4x2(UInt2 row1, UInt2 row2, UInt2 row3, UInt2 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m41 = row4.X; + this.m42 = row4.Y; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt2 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref uint M32 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref uint M41 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref uint M42 => throw new InvalidExecutionContextException($"{typeof(UInt4x2)}.M42"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt4x2(uint x) + { + UInt4x2 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m41 = x; + matrix.m42 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt4x2 operator -(UInt4x2 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt4x2 operator +(UInt4x2 left, UInt4x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt4x2 operator /(UInt4x2 left, UInt4x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt4x2 operator *(UInt4x2 left, UInt4x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt4x2 operator -(UInt4x2 left, UInt4x2 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x2)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 48, Pack = 4)] + public partial struct UInt4x3 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m21; + + [FieldOffset(16)] + private uint m22; + + [FieldOffset(20)] + private uint m23; + + [FieldOffset(24)] + private uint m31; + + [FieldOffset(28)] + private uint m32; + + [FieldOffset(32)] + private uint m33; + + [FieldOffset(36)] + private uint m41; + + [FieldOffset(40)] + private uint m42; + + [FieldOffset(44)] + private uint m43; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + public UInt4x3(uint m11, uint m12, uint m13, uint m21, uint m22, uint m23, uint m31, uint m32, uint m33, uint m41, uint m42, uint m43) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public UInt4x3(UInt3 row1, UInt3 row2, UInt3 row3, UInt3 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt3 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref uint M23 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref uint M32 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref uint M33 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref uint M41 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref uint M42 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref uint M43 => throw new InvalidExecutionContextException($"{typeof(UInt4x3)}.M43"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt4x3(uint x) + { + UInt4x3 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt4x3 operator -(UInt4x3 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt4x3 operator +(UInt4x3 left, UInt4x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt4x3 operator /(UInt4x3 left, UInt4x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt4x3 operator *(UInt4x3 left, UInt4x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt4x3 operator -(UInt4x3 left, UInt4x3 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x3)}.-"); + } + + /// + [StructLayout(LayoutKind.Explicit, Size = 64, Pack = 4)] + public partial struct UInt4x4 + { + [FieldOffset(0)] + private uint m11; + + [FieldOffset(4)] + private uint m12; + + [FieldOffset(8)] + private uint m13; + + [FieldOffset(12)] + private uint m14; + + [FieldOffset(16)] + private uint m21; + + [FieldOffset(20)] + private uint m22; + + [FieldOffset(24)] + private uint m23; + + [FieldOffset(28)] + private uint m24; + + [FieldOffset(32)] + private uint m31; + + [FieldOffset(36)] + private uint m32; + + [FieldOffset(40)] + private uint m33; + + [FieldOffset(44)] + private uint m34; + + [FieldOffset(48)] + private uint m41; + + [FieldOffset(52)] + private uint m42; + + [FieldOffset(56)] + private uint m43; + + [FieldOffset(60)] + private uint m44; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the component at position [1, 1]. + /// The value to assign to the component at position [1, 2]. + /// The value to assign to the component at position [1, 3]. + /// The value to assign to the component at position [1, 4]. + /// The value to assign to the component at position [2, 1]. + /// The value to assign to the component at position [2, 2]. + /// The value to assign to the component at position [2, 3]. + /// The value to assign to the component at position [2, 4]. + /// The value to assign to the component at position [3, 1]. + /// The value to assign to the component at position [3, 2]. + /// The value to assign to the component at position [3, 3]. + /// The value to assign to the component at position [3, 4]. + /// The value to assign to the component at position [4, 1]. + /// The value to assign to the component at position [4, 2]. + /// The value to assign to the component at position [4, 3]. + /// The value to assign to the component at position [4, 4]. + public UInt4x4(uint m11, uint m12, uint m13, uint m14, uint m21, uint m22, uint m23, uint m24, uint m31, uint m32, uint m33, uint m34, uint m41, uint m42, uint m43, uint m44) + { + this.m11 = m11; + this.m12 = m12; + this.m13 = m13; + this.m14 = m14; + this.m21 = m21; + this.m22 = m22; + this.m23 = m23; + this.m24 = m24; + this.m31 = m31; + this.m32 = m32; + this.m33 = m33; + this.m34 = m34; + this.m41 = m41; + this.m42 = m42; + this.m43 = m43; + this.m44 = m44; + } + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value to assign to the row at position [1]. + /// The value to assign to the row at position [2]. + /// The value to assign to the row at position [3]. + /// The value to assign to the row at position [4]. + public UInt4x4(UInt4 row1, UInt4 row2, UInt4 row3, UInt4 row4) + { + this.m11 = row1.X; + this.m12 = row1.Y; + this.m13 = row1.Z; + this.m14 = row1.W; + this.m21 = row2.X; + this.m22 = row2.Y; + this.m23 = row2.Z; + this.m24 = row2.W; + this.m31 = row3.X; + this.m32 = row3.Y; + this.m33 = row3.Z; + this.m34 = row3.W; + this.m41 = row4.X; + this.m42 = row4.Y; + this.m43 = row4.Z; + this.m44 = row4.W; + } + + /// + /// Gets a reference to a specific row in the current instance. + /// + /// The row to access. + public ref UInt4 this[int row] => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}[int]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + public ref UInt2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + public ref UInt3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a swizzled reference to a specific sequence of items in the current instance. + /// + /// The identifier of the first item to index. + /// The identifier of the second item to index. + /// The identifier of the third item to index. + /// The identifier of the fourth item to index. + public ref UInt4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}[{nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}, {nameof(MatrixIndex)}]"); + + /// + /// Gets a reference to the value representing the component at position [1, 1]. + /// + public ref uint M11 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M11"); + + /// + /// Gets a reference to the value representing the component at position [1, 2]. + /// + public ref uint M12 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M12"); + + /// + /// Gets a reference to the value representing the component at position [1, 3]. + /// + public ref uint M13 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M13"); + + /// + /// Gets a reference to the value representing the component at position [1, 4]. + /// + public ref uint M14 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M14"); + + /// + /// Gets a reference to the value representing the component at position [2, 1]. + /// + public ref uint M21 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M21"); + + /// + /// Gets a reference to the value representing the component at position [2, 2]. + /// + public ref uint M22 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M22"); + + /// + /// Gets a reference to the value representing the component at position [2, 3]. + /// + public ref uint M23 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M23"); + + /// + /// Gets a reference to the value representing the component at position [2, 4]. + /// + public ref uint M24 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M24"); + + /// + /// Gets a reference to the value representing the component at position [3, 1]. + /// + public ref uint M31 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M31"); + + /// + /// Gets a reference to the value representing the component at position [3, 2]. + /// + public ref uint M32 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M32"); + + /// + /// Gets a reference to the value representing the component at position [3, 3]. + /// + public ref uint M33 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M33"); + + /// + /// Gets a reference to the value representing the component at position [3, 4]. + /// + public ref uint M34 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M34"); + + /// + /// Gets a reference to the value representing the component at position [4, 1]. + /// + public ref uint M41 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M41"); + + /// + /// Gets a reference to the value representing the component at position [4, 2]. + /// + public ref uint M42 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M42"); + + /// + /// Gets a reference to the value representing the component at position [4, 3]. + /// + public ref uint M43 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M43"); + + /// + /// Gets a reference to the value representing the component at position [4, 4]. + /// + public ref uint M44 => throw new InvalidExecutionContextException($"{typeof(UInt4x4)}.M44"); + + /// + /// Creates a new value with the same value for all its components. + /// + /// The value to use for the components of the new instance. + public static implicit operator UInt4x4(uint x) + { + UInt4x4 matrix; + + matrix.m11 = x; + matrix.m12 = x; + matrix.m13 = x; + matrix.m14 = x; + matrix.m21 = x; + matrix.m22 = x; + matrix.m23 = x; + matrix.m24 = x; + matrix.m31 = x; + matrix.m32 = x; + matrix.m33 = x; + matrix.m34 = x; + matrix.m41 = x; + matrix.m42 = x; + matrix.m43 = x; + matrix.m44 = x; + + return matrix; + } + + /// + /// Negates a value. + /// + /// The value to negate. + public static UInt4x4 operator -(UInt4x4 matrix) => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}.-"); + + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static UInt4x4 operator +(UInt4x4 left, UInt4x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}.+"); + + /// + /// Divides two values (elementwise division). + /// + /// The first value to divide. + /// The second value to divide. + public static UInt4x4 operator /(UInt4x4 left, UInt4x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}./"); + + /// + /// Multiplies two values (elementwise product). + /// + /// The first value to multiply. + /// The second value to multiply. + public static UInt4x4 operator *(UInt4x4 left, UInt4x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static UInt4x4 operator -(UInt4x4 left, UInt4x4 right) => throw new InvalidExecutionContextException($"{nameof(UInt4x4)}.-"); + } +} diff --git a/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.tt b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.tt new file mode 100644 index 00000000..59d27cd9 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/UInt/UIntMxN.tt @@ -0,0 +1,4 @@ +<#@include file="..\MatrixType.ttinclude" #> +<# +GenerateAllMatrixProperties("UInt", sizeof(uint)); +#> \ No newline at end of file diff --git a/src/ComputeSharp/Core/Primitives/VectorType.ttinclude b/src/ComputeSharp/Core/Primitives/VectorType.ttinclude new file mode 100644 index 00000000..5ab90379 --- /dev/null +++ b/src/ComputeSharp/Core/Primitives/VectorType.ttinclude @@ -0,0 +1,194 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Text.RegularExpressions" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".g.cs"#> +<# +IEnumerable EnumeratePropertyNames(string source) +{ + // Creates a comparison for a string based on indices of each character in a key + static int CompareBy(string text, string key) + { + return text.Select(c => key.IndexOf(c)).Aggregate(0, (r, i) => (r << 4) + i); + } + + // Returns all combinations from an input string + static IEnumerable Combinations(string text) + { + if (text.Length > 1) + { + for (int i = text.Length - 1; i >= 0; i--) + { + var characters = text.ToList(); + + characters.RemoveAt(i); + + string substring = string.Join("", characters); + + foreach (var combination in Combinations(substring)) + { + yield return combination; + } + } + } + + yield return text; + } + + // Returns all permutations (with repetition) of a given string + static IEnumerable Permutations(string text) + { + static IEnumerable EnumeratePermutations(string text, int length) + { + if (length == 1) return text.Select(c => c.ToString()); + + return EnumeratePermutations(text, length - 1).SelectMany(s => text, (s1, s2) => s1 + s2); + } + + return EnumeratePermutations(text, text.Length); + } + + return + Combinations(source) + .Distinct() + .SelectMany(Permutations) + .OrderBy(s => s.Length) + .ThenBy(s => CompareBy(s, source)) + .Distinct(); +} + +// Generates all vector access properties for a specified type +void GenerateVectorProperties(string typeName, int elementSize) +{ + string elementTypeName = Regex.Match(typeName, @"^[A-Za-z]+").Value; + string hlslElementTypeName = elementTypeName.ToLower(); + int i = int.Parse(Regex.Match(typeName, @"\d+$").Value); +#> +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; + +namespace ComputeSharp +{ + /// + [StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>, Pack = <#=elementSize#>)] + public partial struct <#=typeName#> + { +<# + PushIndent(" "); + PushIndent(" "); + + // Generate the private fields + foreach (char name in "xyzw".Substring(0, i)) + { + WriteLine($"[FieldOffset({"xyzw".IndexOf(name) * elementSize})]"); + WriteLine($"private {hlslElementTypeName} {name};"); + WriteLine(""); + } + + PopIndent(); + PopIndent(); +#> + /// + /// Gets a reference to a specific component in the current instance. + /// + /// The index of the component to access. + public ref <#=hlslElementTypeName#> this[int i] => throw new InvalidExecutionContextException($"{nameof(<#=typeName#>)}[int]"); +<# + PushIndent(" "); + PushIndent(" "); + + // Generate the combinatorial swizzling properties + foreach ( + var propertyName in + from source in new[] { "XYZW", "RGBA" } + from name in EnumeratePropertyNames(source) + where name.Length <= i + select name) + { + WriteLine(""); + + string propertyType = propertyName.Length == 1 ? hlslElementTypeName : $"{elementTypeName}{propertyName.Length}"; + bool isReadonly = propertyName.Distinct().Count() < propertyName.Length; + string refType = isReadonly ? "ref readonly" : "ref"; + + // XML docs + WriteLine("/// "); + if (propertyName.Length == 1) + { + WriteLine($"/// Gets a reference to the value representing the {propertyName} component."); + } + else + { + Write("/// Gets a "); + if (isReadonly) Write("readonly "); + Write($"reference to the value with the components "); + Write(string.Join(", ", propertyName.Select(c => $""))); + WriteLine("."); + } + WriteLine("/// "); + + // Property + Write($"public {refType} {propertyType} {propertyName} "); + WriteLine($"=> throw new InvalidExecutionContextException($\"{{nameof({typeName})}}.{{nameof({propertyName})}}\");"); + } + + PopIndent(); + PopIndent(); + + // Generate the negation operator + if (elementTypeName != "Bool" && elementTypeName != "UInt") + { + WriteLine(""); + + string argumentName = "xyzw".Substring(0, i); +#> + /// + /// Negates a value. + /// + /// The value to negate. + public static <#=typeName#> operator -(<#=typeName#> <#=argumentName#>) => throw new InvalidExecutionContextException($"{nameof(<#=typeName#>)}.-"); +<# + } + + // Generate the numerical operators + if (elementTypeName != "Bool") + { + WriteLine(""); +#> + /// + /// Sums two values. + /// + /// The first value to sum. + /// The second value to sum. + public static <#=typeName#> operator +(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=typeName#>)}.+"); + + /// + /// Divides two values. + /// + /// The first value to divide. + /// The second value to divide. + public static <#=typeName#> operator /(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=typeName#>)}./"); + + /// + /// Multiplies two values. + /// + /// The first value to multiply. + /// The second value to multiply. + public static <#=typeName#> operator *(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=typeName#>)}.*"); + + /// + /// Subtracts two values. + /// + /// The first value to subtract. + /// The second value to subtract. + public static <#=typeName#> operator -(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{nameof(<#=typeName#>)}.-"); +<# + } +#> + } +} +<# +} +#> \ No newline at end of file diff --git a/src/ComputeSharp/Extensions/GraphicsDeviceExtensions.cs b/src/ComputeSharp/Extensions/GraphicsDeviceExtensions.cs deleted file mode 100644 index 7bd3d7e2..00000000 --- a/src/ComputeSharp/Extensions/GraphicsDeviceExtensions.cs +++ /dev/null @@ -1,75 +0,0 @@ -using ComputeSharp.Graphics; -using ComputeSharp.Shaders; - -namespace ComputeSharp -{ - /// - /// A that contains extension methods for the type, used to run compute shaders - /// - public static class GraphicsDeviceExtensions - { - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters - /// - /// The type of compute shader to run - /// The to use to run the shader - /// The number of iterations to run on the X axis - /// The input instance representing the compute shader to run - public static void For(this GraphicsDevice device, int x, in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, 1, 1, shader); - } - - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters - /// - /// The type of compute shader to run - /// The to use to run the shader - /// The number of iterations to run on the X axis - /// The number of iterations to run on the Y axis - /// The input instance representing the compute shader to run - public static void For(this GraphicsDevice device, int x, int y, in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, y, 1, shader); - } - - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters - /// - /// The type of compute shader to run - /// The to use to run the shader - /// The number of iterations to run on the X axis - /// The number of iterations to run on the Y axis - /// The number of iterations to run on the Z axis - /// The input instance representing the compute shader to run - public static void For(this GraphicsDevice device, int x, int y, int z, in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, y, z, shader); - } - - /// - /// Compiles and runs the input shader on a target instance, with the specified parameters - /// - /// The type of compute shader to run - /// The to use to run the shader - /// The number of iterations to run on the X axis - /// The number of iterations to run on the Y axis - /// The number of iterations to run on the Z axis - /// The number of threads in each thread group for the X axis - /// The number of threads in each thread group for the Y axis - /// The number of threads in each thread group for the Z axis - /// The input instance representing the compute shader to run - public static void For( - this GraphicsDevice device, - int x, int y, int z, - int threadsX, int threadsY, int threadsZ, - in T shader) - where T : struct, IComputeShader - { - ShaderRunner.Run(device, x, y, z, threadsX, threadsY, threadsZ, shader); - } - } -} diff --git a/src/ComputeSharp/Extensions/Windows.Foundation/PointExtensions.cs b/src/ComputeSharp/Extensions/Windows.Foundation/PointExtensions.cs deleted file mode 100644 index 4c636790..00000000 --- a/src/ComputeSharp/Extensions/Windows.Foundation/PointExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Diagnostics.Contracts; -using System.Numerics; - -namespace Windows.Foundation -{ - /// - /// A with some extension methods for the type - /// - public static class PointExtensions - { - /// - /// Converts a value to a - /// - /// The input to convert - /// A value representing the input - [Pure] - public static Vector2 ToVector2(this in Point value) => new Vector2((float)value.X, (float)value.Y); - - /// - /// Converts a value to a - /// - /// The input to convert - /// A value representing the input - [Pure] - public static Point ToPoint(this in Vector2 value) => new Point(value.X, value.Y); - } -} diff --git a/src/ComputeSharp/Extensions/Windows.Foundation/RectExtensions.cs b/src/ComputeSharp/Extensions/Windows.Foundation/RectExtensions.cs deleted file mode 100644 index 55956a6e..00000000 --- a/src/ComputeSharp/Extensions/Windows.Foundation/RectExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Diagnostics.Contracts; -using System.Numerics; - -namespace Windows.Foundation -{ - /// - /// A with some extension methods for the type - /// - public static class RectExtensions - { - /// - /// Converts a value to a - /// - /// The input to convert - /// A value representing the input - /// The input is read in the following order: , , , - [Pure] - public static Vector4 ToVector2(this in Rect value) => new Vector4((float)value.Left, (float)value.Top, (float)value.Right, (float)value.Bottom); - - /// - /// Converts a value to a - /// - /// The input to convert - /// A value representing the input - /// The input is assigned in the following order: , , , - [Pure] - public static Rect ToPoint(this in Vector4 value) => new Rect(value.X, value.Y, value.Z, value.W); - } -} \ No newline at end of file diff --git a/src/ComputeSharp/Extensions/Windows.Foundation/SizeExtensions.cs b/src/ComputeSharp/Extensions/Windows.Foundation/SizeExtensions.cs deleted file mode 100644 index f8871206..00000000 --- a/src/ComputeSharp/Extensions/Windows.Foundation/SizeExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Diagnostics.Contracts; -using System.Numerics; - -namespace Windows.Foundation -{ - /// - /// A with some extension methods for the type - /// - public static class SizeExtensions - { - /// - /// Converts a value to a - /// - /// The input to convert - /// A value representing the input - /// The input is read in the following order: , - [Pure] - public static Vector2 ToVector2(this in Size value) => new Vector2((float)value.Width, (float)value.Height); - - /// - /// Converts a value to a - /// - /// The input to convert - /// A value representing the input - /// The input is assigned in the following order: , - [Pure] - public static Size ToPoint(this in Vector2 value) => new Size(value.X, value.Y); - } -} \ No newline at end of file diff --git a/src/ComputeSharp/Gpu.cs b/src/ComputeSharp/Gpu.cs index 26ae6399..affd1d93 100644 --- a/src/ComputeSharp/Gpu.cs +++ b/src/ComputeSharp/Gpu.cs @@ -1,55 +1,56 @@ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; -using System.Linq; -using ComputeSharp.Graphics; using ComputeSharp.Graphics.Helpers; -using Vortice.Direct3D12; -using Vortice.DXGI; namespace ComputeSharp { /// - /// A that acts as an entry-point for all the library APIs, exposing the available GPU devices + /// A that acts as an entry-point for all the library APIs, exposing the available GPU devices. /// public static class Gpu { /// - /// Initializes the field and property + /// The instance used to produce the default device for . /// - static Gpu() - { - Devices = DeviceHelper.QueryAllSupportedDevices(); - IsSupported = Devices.Any(); + private static readonly Lazy DefaultFactory = new(DeviceHelper.GetDefaultDevice); - if (IsSupported) - { - _Default = new GraphicsDevice(Devices[0].Device, Devices[0].Description); - } + /// + /// Gets whether or not the APIs can be used on the + /// current machine (ie. if there is at least a supported GPU device). + /// + public static bool IsSupported => DeviceHelper.IsDefaultDeviceAvailable(); + + /// + /// Gets the default instance for the current machine. + /// This instance cannot be manually disposed - attempting to do so is safe and it will + /// not cause an exception, but it will simply do nothing and not dispose the device. + /// + /// Thrown when a default device is not available. + /// Make sure to check before accessing this property. + public static GraphicsDevice Default => DefaultFactory.Value; + + /// + /// Enumerates all the currently available DX12.0 devices. Note that creating a device is a relatively + /// expensive operation, so consider using to be able to filter the available + /// devices before creating them, to reduce the system overhead and avoiding creating unnecessary devices. + /// + /// A sequence of instances. + [Pure] + public static IEnumerable EnumerateDevices() + { + return new DeviceHelper.DeviceQuery(static _ => true); } /// - /// The loaded collection of supported devices and descriptions + /// Executes a query on the currently available DX12.0 devices matching a given predicate. /// - private static readonly IReadOnlyList<(ID3D12Device Device, AdapterDescription Description)> Devices; - - private static readonly GraphicsDevice? _Default; - - /// - /// Gets the default instance for the current machine - /// - public static GraphicsDevice Default => _Default ?? throw new NotSupportedException("There isn't a supported GPU device on the current machine"); - - /// - /// Gets whether or not the APIs can be used on the current machine (ie. if there is at least a supported GPU device) - /// - public static bool IsSupported { get; } - - /// - /// Enumerates all the available objects on the current machine - /// - /// A sequence of supported objects that can be used to run compute shaders + /// The predicate to use to select the devices to create. + /// A sequence of instances matching . [Pure] - public static IEnumerable EnumerateDevices() => Devices.Select(device => new GraphicsDevice(device.Device, device.Description)); + public static IEnumerable QueryDevices(Predicate predicate) + { + return new DeviceHelper.DeviceQuery(predicate); + } } } diff --git a/src/ComputeSharp/Graphics/Commands/CommandList.cs b/src/ComputeSharp/Graphics/Commands/CommandList.cs new file mode 100644 index 00000000..993ece90 --- /dev/null +++ b/src/ComputeSharp/Graphics/Commands/CommandList.cs @@ -0,0 +1,103 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Graphics.Extensions; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; + +namespace ComputeSharp.Graphics.Commands +{ + /// + /// A command list to set and execute operations on the GPU. + /// + internal unsafe ref struct CommandList + { + /// + /// The instance associated with the current command list. + /// + private readonly GraphicsDevice device; + + /// + /// The command list type being used by the current instance. + /// + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The object in use by the current instance. + /// + private ComPtr d3D12CommandAllocator; + + /// + /// The object in use by the current instance. + /// + private ComPtr d3D12GraphicsCommandList; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The target instance to use. + /// The type of command list to create. + public CommandList(GraphicsDevice device, D3D12_COMMAND_LIST_TYPE d3D12CommandListType) + { + this.device = device; + this.d3D12CommandListType = d3D12CommandListType; + this.d3D12CommandAllocator = device.GetCommandAllocator(d3D12CommandListType); + this.d3D12GraphicsCommandList = device.D3D12Device->CreateCommandList(d3D12CommandListType, this.d3D12CommandAllocator); + + // Set the heap descriptor if the command list is not for copy operations + if (d3D12CommandListType is not D3D12_COMMAND_LIST_TYPE_COPY) + { + device.SetDescriptorHeapForCommandList(this.d3D12GraphicsCommandList); + } + } + + /// + /// Gets the command list type being used by the current instance. + /// + public readonly D3D12_COMMAND_LIST_TYPE D3D12CommandListType => this.d3D12CommandListType; + + /// + /// Gets the object in use by the current instance. + /// + public readonly ID3D12GraphicsCommandList* D3D12GraphicsCommandList => this.d3D12GraphicsCommandList.Get(); + + /// + /// Detaches the object in use by the current instance. + /// + /// The object in use, with ownership. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ComPtr DetachD3D12CommandAllocator() + { + return this.d3D12CommandAllocator.Move(); + } + + /// + /// Gets a pointer to the object in use by the current instance. + /// + /// A double pointer to the current object to execute. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly ID3D12CommandList** GetD3D12CommandListAddressOf() + { + return (ID3D12CommandList**)this.d3D12GraphicsCommandList.GetAddressOf(); + } + + /// + /// Executes the commands in the current commands list, and waits for completion. + /// + public void ExecuteAndWaitForCompletion() + { + this.d3D12GraphicsCommandList.Get()->Close(); + + this.device.ExecuteCommandList(ref this); + } + + /// + public void Dispose() + { + this.d3D12CommandAllocator.Dispose(); + this.d3D12GraphicsCommandList.Dispose(); + } + } +} diff --git a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12CommandAllocatorPool.cs b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12CommandAllocatorPool.cs new file mode 100644 index 00000000..85461480 --- /dev/null +++ b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12CommandAllocatorPool.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Graphics.Extensions; +using TerraFX.Interop; + +namespace ComputeSharp.Graphics.Commands.Interop +{ + /// + /// A type that acts as a pool to get new instances wheen needed. + /// + internal readonly unsafe struct ID3D12CommandAllocatorPool + { + /// + /// The command list type being used by the current instance. + /// + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The queue of currently pooled instances. + /// + private readonly Queue> d3D12CommandAllocatorQueue; + + /// + /// Creates a new instance with the specified values. + /// + /// The command list type to use. + public ID3D12CommandAllocatorPool(D3D12_COMMAND_LIST_TYPE d3D12CommandListType) + { + this.d3D12CommandListType = d3D12CommandListType; + this.d3D12CommandAllocatorQueue = new(); + } + + /// + /// Adds a new item to the internal pool queue. + /// + /// The input to enqueue. + public void Enqueue(ComPtr d3D12CommandAllocator) + { + lock (this.d3D12CommandAllocatorQueue) + { + this.d3D12CommandAllocatorQueue.Enqueue(d3D12CommandAllocator); + } + } + + /// + /// Gets a new or reused item to use to issue GPU commands. + /// + /// The rented object to use. + public ComPtr GetCommandAllocator(ID3D12Device* d3D12Device, ID3D12Fence* d3D12Fence) + { + using ComPtr d3D12CommandAllocator = default; + + lock (this.d3D12CommandAllocatorQueue) + { + if (this.d3D12CommandAllocatorQueue.TryDequeue(out *&d3D12CommandAllocator)) + { + d3D12CommandAllocator.Get()->Reset().Assert(); + + return d3D12CommandAllocator.Move(); + } + + return d3D12Device->CreateCommandAllocator(this.d3D12CommandListType); + } + } + + /// + public void Dispose() + { + lock (this.d3D12CommandAllocatorQueue) + { + foreach (ComPtr d3D12CommandAllocator in this.d3D12CommandAllocatorQueue) + { + d3D12CommandAllocator.Dispose(); + } + + this.d3D12CommandAllocatorQueue.Clear(); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs new file mode 100644 index 00000000..e0b0c05b --- /dev/null +++ b/src/ComputeSharp/Graphics/Commands/Interop/ID3D12DescriptorHandleAllocator.cs @@ -0,0 +1,178 @@ +using System; +using ComputeSharp.Graphics.Extensions; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_TYPE; + +namespace ComputeSharp.Graphics.Commands.Interop +{ + /// + /// A type that provides logic to create resource descriptors for a instance. + /// + internal unsafe struct ID3D12DescriptorHandleAllocator : IDisposable + { + /// + /// The default number of available descriptors per heap. + /// + private const uint DescriptorsPerHeap = 4096; + + /// + /// The in use for the current instance. + /// + private ComPtr d3D12DescriptorHeap; + + /// + /// The array of items with the available descriptor handles. + /// + private readonly D3D12DescriptorHandlePair[] d3D12DescriptorHandlePairs; + + /// + /// The head index for the queue. + /// + private int head; + + /// + /// The tail index for the queue. + /// + private int tail; + + /// + /// The current size of the queue (ie. the number of remaining pairs in ). + /// + private int size; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance to use. + public ID3D12DescriptorHandleAllocator(ID3D12Device* device) + { + this.d3D12DescriptorHeap = device->CreateDescriptorHeap(DescriptorsPerHeap); + this.d3D12DescriptorHandlePairs = GC.AllocateUninitializedArray((int)DescriptorsPerHeap); + this.head = 0; + this.tail = 0; + this.size = (int)DescriptorsPerHeap; + + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle = this.d3D12DescriptorHeap.Get()->GetCPUDescriptorHandleForHeapStart(); + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandleStart = this.d3D12DescriptorHeap.Get()->GetGPUDescriptorHandleForHeapStart(); + uint descriptorIncrementSize = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); + + for (int i = 0; i < this.d3D12DescriptorHandlePairs.Length; i++) + { + this.d3D12DescriptorHandlePairs[i] = new D3D12DescriptorHandlePair( + in d3D12CpuDescriptorHandle, + in d3D12GpuDescriptorHandleStart, + i, + descriptorIncrementSize); + } + } + + /// + /// Gets the in use for the current instance. + /// + public ID3D12DescriptorHeap* D3D12DescriptorHeap => this.d3D12DescriptorHeap; + + /// + /// Rents a new CPU and GPU handle pair to use in a memory buffer. + /// + /// The resulting value. + /// The resulting value. + public void Rent( + out D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + out D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + lock (this.d3D12DescriptorHandlePairs) + { + Guard.IsGreaterThan(this.size, 0, nameof(size)); + + ref readonly D3D12DescriptorHandlePair d3D12DescriptorHandlePair = ref this.d3D12DescriptorHandlePairs[this.head++]; + + d3D12CpuDescriptorHandle = d3D12DescriptorHandlePair.D3D12CpuDescriptorHandle; + d3D12GpuDescriptorHandle = d3D12DescriptorHandlePair.D3D12GpuDescriptorhandle; + + if (this.head == DescriptorsPerHeap) + { + this.head = 0; + } + + this.size--; + } + } + + /// + /// Returns a CPU and GPU handle pair for later use. + /// + /// The returned value. + /// The returned value. + public void Return( + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + lock (this.d3D12DescriptorHandlePairs) + { + Guard.IsLessThan(this.size, DescriptorsPerHeap, nameof(size)); + + this.d3D12DescriptorHandlePairs[this.tail++] = new D3D12DescriptorHandlePair(d3D12CpuDescriptorHandle, d3D12GpuDescriptorHandle); + + if (this.tail == DescriptorsPerHeap) + { + this.tail = 0; + } + + this.size++; + } + } + + /// + public void Dispose() + { + this.d3D12DescriptorHeap.Dispose(); + } + + /// + /// A type representing a pair of reusable descriptor handles. + /// + private readonly struct D3D12DescriptorHandlePair + { + /// + /// The value for the current entry. + /// + public readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; + + /// + /// The value for the current entry. + /// + public readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorhandle; + + /// + /// Creates a new instance with the given parameters. + /// + /// The value to wrap. + /// The value to wrap. + public D3D12DescriptorHandlePair( + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + D3D12CpuDescriptorHandle = d3D12CpuDescriptorHandle; + D3D12GpuDescriptorhandle = d3D12GpuDescriptorHandle; + } + + /// + /// Creates a new instance with the given parameters. + /// + /// The base value. + /// The base value. + /// The offset for the new pair of handles to compute. + /// The increment size for each consecutive handles pair. + public D3D12DescriptorHandlePair( + in D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandleStart, + in D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandleStart, + int offset, + uint descriptorIncrementSize) + { + D3D12_CPU_DESCRIPTOR_HANDLE.InitOffsetted(out D3D12CpuDescriptorHandle, in d3D12CpuDescriptorHandleStart, offset, descriptorIncrementSize); + D3D12_GPU_DESCRIPTOR_HANDLE.InitOffsetted(out D3D12GpuDescriptorhandle, in d3D12GpuDescriptorHandleStart, offset, descriptorIncrementSize); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Commands/PipelineData.cs b/src/ComputeSharp/Graphics/Commands/PipelineData.cs new file mode 100644 index 00000000..7f0e16d1 --- /dev/null +++ b/src/ComputeSharp/Graphics/Commands/PipelineData.cs @@ -0,0 +1,51 @@ +using ComputeSharp.Interop; +using TerraFX.Interop; + +namespace ComputeSharp.Graphics.Commands +{ + /// + /// A representing a custom pipeline state for a compute operation. + /// + internal sealed unsafe class PipelineData : NativeObject + { + /// + /// The instance for the current object. + /// + private ComPtr d3D12RootSignature; + + /// + /// The instance for the current object. + /// + private ComPtr d3D12PipelineState; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The value for the current shader. + /// The compiled pipeline state to reuse for the current shader. + public PipelineData(ID3D12RootSignature* d3D12RootSignature, ID3D12PipelineState* d3D12PipelineState) + { + this.d3D12RootSignature = new ComPtr(d3D12RootSignature); + this.d3D12PipelineState = new ComPtr(d3D12PipelineState); + } + + /// + /// Gets the instance for the current object. + /// + public ID3D12RootSignature* D3D12RootSignature => this.d3D12RootSignature; + + /// + /// Gets the instance for the current object. + /// + public ID3D12PipelineState* D3D12PipelineState => this.d3D12PipelineState; + + /// + protected override bool OnDispose() + { + this.d3D12RootSignature.Dispose(); + this.d3D12PipelineState.Dispose(); + + return true; + } + } +} diff --git a/src/ComputeSharp/Graphics/Exceptions/GraphicsDeviceMismatchException.cs b/src/ComputeSharp/Graphics/Exceptions/GraphicsDeviceMismatchException.cs new file mode 100644 index 00000000..39987597 --- /dev/null +++ b/src/ComputeSharp/Graphics/Exceptions/GraphicsDeviceMismatchException.cs @@ -0,0 +1,120 @@ +using System; +using System.Diagnostics.Contracts; +using System.Text; +using ComputeSharp.Interop; +using ComputeSharp.Resources; + +namespace ComputeSharp.Exceptions +{ + /// + /// A custom that indicates when mismatched devices are being used. + /// + public sealed class GraphicsDeviceMismatchException : InvalidOperationException + { + /// + /// Creates a new instance. + /// + /// The message that describes the error. + private GraphicsDeviceMismatchException(string message) + : base(message) + { + } + + /// + /// Creates a new instance from the specified parameters. + /// + /// The input that was used. + /// The source instance tied to . + /// The target instance that was used. + /// A new instance with a formatted error message. + /// + /// This method only takes a instance and the associated instance as + /// will still be available, but without the unnecessary generic type specializations for the method. + /// + [Pure] + private static GraphicsDeviceMismatchException Create(NativeObject resource, GraphicsDevice sourceDevice, GraphicsDevice destinationDevice) + { + StringBuilder builder = new(512); + + builder.AppendLine("Invalid pairing of graphics devices used to run a compute shader and allocate memory buffers."); + builder.AppendLine($"The target device to run the compute shader is \"{destinationDevice}\"."); + builder.AppendLine($"The buffer of type {resource.GetType()} was allocated on device \"{sourceDevice}\"."); + builder.Append("Make sure to always allocate buffers on the same device used to actually run the code that accesses them."); + builder.ToString(); + + return new(builder.ToString()); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(Buffer buffer, GraphicsDevice device) + where T : unmanaged + { + throw Create(buffer, buffer.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(Texture2D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(Texture3D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(TransferBuffer buffer, GraphicsDevice device) + where T : unmanaged + { + throw Create(buffer, buffer.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(TransferTexture2D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the input buffer. + /// The input that was used. + /// The target instance that was used. + internal static void Throw(TransferTexture3D texture, GraphicsDevice device) + where T : unmanaged + { + throw Create(texture, texture.GraphicsDevice, device); + } + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs b/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs new file mode 100644 index 00000000..d2dbc529 --- /dev/null +++ b/src/ComputeSharp/Graphics/Exceptions/UnsupportedTextureTypeException.cs @@ -0,0 +1,69 @@ +using System; +using System.Diagnostics.Contracts; +using System.Text; +using Microsoft.Toolkit.Diagnostics; + +namespace ComputeSharp.Exceptions +{ + /// + /// A custom that indicates when a texture was attempted to be created with an unsupported type. + /// + public sealed class UnsupportedTextureTypeException : InvalidOperationException + { + /// + /// Creates a new instance. + /// + /// The message that describes the error. + private UnsupportedTextureTypeException(string message) + : base(message) + { + } + + /// + /// Creates a new instance from the specified parameters. + /// + /// The rank of the texture that couldn't be created. + /// The element type of texture that was being created. + /// A new instance with a formatted error message. + [Pure] + private static UnsupportedTextureTypeException Create(int rank, Type type) + { + StringBuilder builder = new(256); + + builder.AppendLine($"The device in use does not support creating {rank}D textures of type {type}."); + builder.Append($"Make sure to check the support at runtime by using {nameof(GraphicsDevice)}."); + + builder.AppendLine(rank switch + { + 2 => $"{nameof(GraphicsDevice.IsReadOnlyTexture2DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture2DSupportedForType)}().", + 3 => $"{nameof(GraphicsDevice.IsReadOnlyTexture3DSupportedForType)}() or {nameof(GraphicsDevice)}.{nameof(GraphicsDevice.IsReadWriteTexture3DSupportedForType)}().", + _ => ThrowHelper.ThrowArgumentException("Invalid texture rank") + }); + + builder.Append("As a possible workaround on older devices, consider using a texture type of lower rank, or a linear buffer."); + builder.ToString(); + + return new(builder.ToString()); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the texture that couldn't be created. + internal static void ThrowForTexture2D() + where T : unmanaged + { + throw Create(2, typeof(T)); + } + + /// + /// Throws a new instance from the specified parameters. + /// + /// The type of values in the texture that couldn't be created. + internal static void ThrowForTexture3D() + where T : unmanaged + { + throw Create(3, typeof(T)); + } + } +} \ No newline at end of file diff --git a/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs new file mode 100644 index 00000000..e231c449 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/BufferExtensions.cs @@ -0,0 +1,156 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; +using ComputeSharp.Resources; +using Microsoft.Toolkit.Diagnostics; + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type. + /// + public static class BufferExtensions + { + /// + /// Reads the contents of a instance and returns an array. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// A array with the contents of the input buffer. + [Pure] + public static T[] ToArray(this Buffer buffer) + where T : unmanaged + { + return buffer.ToArray(0, buffer.Length); + } + + /// + /// Reads the contents of a instance in a given range and returns an array. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The offset to start reading data from. + /// The number of items to read. + /// A array with the contents of the specified range from the current buffer. + [Pure] + public static T[] ToArray(this Buffer buffer, int offset, int count) + where T : unmanaged + { + Guard.IsGreaterThanOrEqualTo(count, 0, nameof(count)); + + T[] data = GC.AllocateUninitializedArray(count); + + buffer.CopyTo(data.AsSpan(), offset); + + return data; + } + + /// + /// Reads the contents of a instance and writes them into a target array. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input array to write data to. + public static void CopyTo(this Buffer buffer, T[] destination) + where T : unmanaged + { + buffer.CopyTo(destination.AsSpan(), 0); + } + + /// + /// Reads the contents of the specified range from a instance and writes them into a target array. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The offset to start reading data from. + /// The number of items to read. + public static void CopyTo(this Buffer buffer, T[] destination, int destinationOffset, int bufferOffset, int count) + where T : unmanaged + { + Span span = destination.AsSpan(destinationOffset, count); + + buffer.CopyTo(span, bufferOffset); + } + + /// + /// Reads the contents of a instance and writes them into a target . + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input to write data to. + public static void CopyTo(this Buffer buffer, Span destination) + where T : unmanaged + { + buffer.CopyTo(destination, 0); + } + + /// + /// Reads the contents of the specified range from a instance and writes them into a target . + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The input to write data to. + /// The offset to start reading data from. + public static void CopyTo(this Buffer buffer, Span destination, int offset) + where T : unmanaged + { + buffer.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, offset); + } + + /// + /// Writes the contents of a given array to a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input array to read data from. + public static void CopyFrom(this Buffer buffer, T[] source) + where T : unmanaged + { + buffer.CopyFrom(source.AsSpan(), 0); + } + + /// + /// Writes the contents of a given array to a specified area of a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The offset to start writing data to. + /// The number of items to write. + public static void CopyFrom(this Buffer buffer, T[] source, int sourceOffset, int bufferOffset, int count) + where T : unmanaged + { + ReadOnlySpan span = source.AsSpan(sourceOffset, count); + + buffer.CopyFrom(span, bufferOffset); + } + + /// + /// Writes the contents of a given to a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input to read data from. + public static void CopyFrom(this Buffer buffer, ReadOnlySpan source) + where T : unmanaged + { + buffer.CopyFrom(source, 0); + } + + /// + /// Writes the contents of a given to a specified area of a instance. + /// + /// The type of items stored on the buffer. + /// The target instance to write data to. + /// The input to read data from. + /// The offset to start writing data to. + public static void CopyFrom(this Buffer buffer, ReadOnlySpan source, int offset) + where T : unmanaged + { + buffer.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, offset); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.cs b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.cs new file mode 100644 index 00000000..834b2bab --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/GraphicsDeviceExtensions.cs @@ -0,0 +1,1135 @@ +using System; +using System.Diagnostics.Contracts; +using ComputeSharp.__Internals; +using ComputeSharp.Resources; +using ComputeSharp.Shaders; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type, used to run compute shaders. + /// + public static class GraphicsDeviceExtensions + { + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size . + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input array with the data to copy on the allocated buffer. + /// A constant instance with the contents of the input array. + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, T[] source) + where T : unmanaged + { + return device.AllocateConstantBuffer(source.AsSpan()); + } + + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A constant instance with the contents of the input . + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, ReadOnlySpan source) + where T : unmanaged + { + ConstantBuffer buffer = new(device, source.Length, AllocationMode.Default); + + buffer.CopyFrom(source); + + return buffer; + } + + /// + /// Allocates a new constant buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A constant instance with the contents of the input . + [Pure] + public static ConstantBuffer AllocateConstantBuffer(this GraphicsDevice device, Buffer source) + where T : unmanaged + { + ConstantBuffer constantBuffer = new(device, source.Length, AllocationMode.Default); + + constantBuffer.CopyFrom(source); + + return constantBuffer; + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size . + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input array with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, T[] source) + where T : unmanaged + { + return device.AllocateReadOnlyBuffer(source.AsSpan()); + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, ReadOnlySpan source) + where T : unmanaged + { + ReadOnlyBuffer buffer = new(device, source.Length, AllocationMode.Default); + + buffer.CopyFrom(source); + + return buffer; + } + + /// + /// Allocates a new readonly buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadOnlyBuffer AllocateReadOnlyBuffer(this GraphicsDevice device, Buffer source) + where T : unmanaged + { + ReadOnlyBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default); + + readWriteBuffer.CopyFrom(source); + + return readWriteBuffer; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged + { + ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged + { + ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture2D AllocateReadOnlyTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, , ]. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged + { + ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged + { + ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, , ]. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadOnlyTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new readonly 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadOnlyTexture3D AllocateReadOnlyTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadOnlyTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size . + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input array with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, T[] source) + where T : unmanaged + { + return device.AllocateReadWriteBuffer(source.AsSpan()); + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, ReadOnlySpan source) + where T : unmanaged + { + ReadWriteBuffer buffer = new(device, source.Length, AllocationMode.Default); + + buffer.CopyFrom(source); + + return buffer; + } + + /// + /// Allocates a new read write buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The input with the data to copy on the allocated buffer. + /// A read write instance with the contents of the input . + [Pure] + public static ReadWriteBuffer AllocateReadWriteBuffer(this GraphicsDevice device, Buffer source) + where T : unmanaged + { + ReadWriteBuffer readWriteBuffer = new(device, source.Length, AllocationMode.Default); + + readWriteBuffer.CopyFrom(source); + + return readWriteBuffer; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged + { + ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged + { + ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[] source, int offset, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture2D(source.AsSpan(offset), width, height); + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, T[,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture2D texture = new(device, source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 2D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture2D AllocateReadWriteTexture2D(this GraphicsDevice device, ReadOnlySpan source, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture2D texture = new(device, width, height, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A zeroed instance of size [, ]. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged + { + ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged + { + ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, , ]. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// The starting offset within to read data from. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input array. + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return device.AllocateReadWriteTexture3D(source.AsSpan(offset), width, height, depth); + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input array with the data to copy on the allocated texture. + /// A read write instance with the contents of the input array. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. + /// That is, the expected layout of the input array has to be [depth, height, width]. + /// + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, T[,,] source) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture3D texture = new(device, source.GetLength(2), source.GetLength(1), source.GetLength(0), AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new writeable 3D texture with the specified parameters. + /// + /// The type of items to store in the texture. + /// The type of pixels used on the GPU side. + /// The instance to use to allocate the texture. + /// The input with the data to copy on the allocated texture. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// A instance with the contents of the input . + [Pure] + public static ReadWriteTexture3D AllocateReadWriteTexture3D(this GraphicsDevice device, ReadOnlySpan source, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + ReadWriteTexture3D texture = new(device, width, height, depth, AllocationMode.Default); + + texture.CopyFrom(source); + + return texture; + } + + /// + /// Allocates a new upload buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A instance of size . + [Pure] + public static UploadBuffer AllocateUploadBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new upload 2D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, ]. + [Pure] + public static UploadTexture2D AllocateUploadTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new upload 3D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, , ]. + [Pure] + public static UploadTexture3D AllocateUploadTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Allocates a new readback buffer with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The length of the buffer to allocate. + /// The allocation mode to use for the new resource. + /// A instance of size . + [Pure] + public static ReadBackBuffer AllocateReadBackBuffer(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, length, allocationMode); + } + + /// + /// Allocates a new readback 2D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, ]. + [Pure] + public static ReadBackTexture2D AllocateReadBackTexture2D(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, allocationMode); + } + + /// + /// Allocates a new readback 3D texture with the specified parameters. + /// + /// The type of items to store in the buffer. + /// The instance to use to allocate the buffer. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + /// A instance of size [, , ]. + [Pure] + public static ReadBackTexture3D AllocateReadBackTexture3D(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default) + where T : unmanaged + { + return new(device, width, height, depth, allocationMode); + } + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, in T shader) + where T : struct, IComputeShader + { + ShaderRunner.Run(device, x, 1, 1, in shader); + } + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, int y, in T shader) + where T : struct, IComputeShader + { + ShaderRunner.Run(device, x, y, 1, in shader); + } + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, int y, int z, in T shader) + where T : struct, IComputeShader + { + ShaderRunner.Run(device, x, y, z, in shader); + } + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The type of compute shader to run. + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + /// The input instance representing the compute shader to run. + public static void For(this GraphicsDevice device, int x, int y, int z, int threadsX, int threadsY, int threadsZ, in T shader) + where T : struct, IComputeShader + { + ShaderRunner.Run(device, x, y, z, threadsX, threadsY, threadsZ, in shader); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/AllocatorExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/AllocatorExtensions.cs new file mode 100644 index 00000000..1e77beb6 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Interop/AllocatorExtensions.cs @@ -0,0 +1,167 @@ +using ComputeSharp.Core.Extensions; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_HEAP_TYPE; +using static TerraFX.Interop.D3D12_RESOURCE_FLAGS; +using static TerraFX.Interop.D3D12_RESOURCE_STATES; +using static TerraFX.Interop.D3D12MA_ALLOCATION_FLAGS; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +namespace ComputeSharp.Graphics.Extensions +{ + /// + /// A with extensions for the type. + /// + internal static unsafe class AllocatorExtensions + { + /// + /// Creates a resource for a given buffer type. + /// + /// The instance in use. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The size in bytes of the current buffer. + /// An reference for the current object. + public static UniquePtr CreateResource( + this ref D3D12MA_Allocator allocator, + ResourceType resourceType, + AllocationMode allocationMode, + ulong sizeInBytes) + { + D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; + (D3D12_HEAP_TYPE d3D12HeapType, + D3D12_RESOURCE_FLAGS d3D12ResourceFlags, + D3D12_RESOURCE_STATES d3D12ResourceStates) = resourceType switch + { + ResourceType.Constant => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), + ResourceType.ReadOnly => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadBack => (D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST), + ResourceType.Upload => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), + _ => ThrowHelper.ThrowArgumentException<(D3D12_HEAP_TYPE, D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; + + using UniquePtr allocation = default; + + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Buffer(sizeInBytes, d3D12ResourceFlags); + + D3D12MA_ALLOCATION_DESC allocationDesc = default; + allocationDesc.HeapType = d3D12HeapType; + allocationDesc.Flags = allocationFlags; + + allocator.CreateResource( + &allocationDesc, + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + allocation.GetAddressOf(), + null, + null).Assert(); + + return allocation.Move(); + } + + /// + /// Creates a resource for a given 2D texture type. + /// + /// The instance in use. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The default value for the resource. + /// An reference for the current object. + public static UniquePtr CreateResource( + this ref D3D12MA_Allocator allocator, + ResourceType resourceType, + AllocationMode allocationMode, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + out D3D12_RESOURCE_STATES d3D12ResourceStates) + { + D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; + D3D12_RESOURCE_FLAGS d3D12ResourceFlags; + + (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch + { + ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), + _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; + + using UniquePtr allocation = default; + + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex2D(dxgiFormat, width, height, mipLevels: 1, flags: d3D12ResourceFlags); + + D3D12MA_ALLOCATION_DESC allocationDesc = default; + allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; + allocationDesc.Flags = allocationFlags; + + allocator.CreateResource( + &allocationDesc, + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + allocation.GetAddressOf(), + null, + null); + + return allocation.Move(); + } + + /// + /// Creates a resource for a given 3D texture type. + /// + /// The instance in use. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The depth of the texture resource. + /// The default value for the resource. + /// An reference for the current object. + public static UniquePtr CreateResource( + this ref D3D12MA_Allocator allocator, + ResourceType resourceType, + AllocationMode allocationMode, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + ushort depth, + out D3D12_RESOURCE_STATES d3D12ResourceStates) + { + D3D12MA_ALLOCATION_FLAGS allocationFlags = allocationMode == AllocationMode.Default ? D3D12MA_ALLOCATION_FLAG_NONE : D3D12MA_ALLOCATION_FLAG_COMMITTED; + D3D12_RESOURCE_FLAGS d3D12ResourceFlags; + + (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch + { + ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), + _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; + + using UniquePtr allocation = default; + + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex3D(dxgiFormat, width, height, depth, mipLevels: 1, flags: d3D12ResourceFlags); + + D3D12MA_ALLOCATION_DESC allocationDesc = default; + allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; + allocationDesc.Flags = allocationFlags; + + allocator.CreateResource( + &allocationDesc, + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + allocation.GetAddressOf(), + null, + null); + + return allocation.Move(); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs new file mode 100644 index 00000000..7458b7d4 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs @@ -0,0 +1,62 @@ +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using TerraFX.Interop; + +namespace ComputeSharp.Core.Extensions +{ + /// + /// Helper methods for working with the type. + /// + internal static class ComPtrExtensions + { + /// + /// Reinterprets the current instance as one of type . + /// + /// The type of the current instance. + /// The input instance to upcast. + /// A instance of type . + /// + /// This method is meant to be used in a chained expression and it does not increment the reference + /// count for the input pointer. Do not expose the return value of this extension to consumers. + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ref readonly ComPtr AsIUnknown(this in ComPtr ptr) + where T : unmanaged + { + return ref Unsafe.As, ComPtr>(ref Unsafe.AsRef(in ptr)); + } + + /// + /// Gets the address of the current instance as a raw double pointer. + /// + /// The type to wrap in the current instance. + /// The input instance to get the address for. + /// The raw pointer to the input instance. + /// This method is only valid when the current instance is on the stack or pinned. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void** GetVoidAddressOf(this in ComPtr ptr) + where T : unmanaged + { + return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr)); + } + + /// + /// Moves the current instance and resets it without releasing the reference. + /// + /// The type to wrap in the current instance. + /// The input instance to move. + /// The moved instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ComPtr Move(this in ComPtr ptr) + where T : unmanaged + { + ComPtr copy = default; + + Unsafe.AsRef(in ptr).Swap(ref copy); + + return copy; + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs new file mode 100644 index 00000000..d3a5b855 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Interop/HResultExtensions.cs @@ -0,0 +1,44 @@ +using System.ComponentModel; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using ComputeSharp.Graphics.Helpers; +using Microsoft.Toolkit.Diagnostics; +using HRESULT = System.Int32; + +namespace ComputeSharp.Core.Extensions +{ + /// + /// Helper methods to efficiently throw exceptions. + /// + [DebuggerStepThrough] + internal static class HResultExtensions + { + /// + /// Throws a if represents an error. + /// + /// The input to check. + /// Thrown if represents an error. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Assert(this HRESULT result) + { +#if DEBUG + bool hasErrorsOrWarnings = DeviceHelper.FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings(); + + if (result < 0) + { + ThrowHelper.ThrowWin32Exception(result); + } + + if (hasErrorsOrWarnings) + { + ThrowHelper.ThrowWin32Exception("Warning or error detected by ID3D12InfoQueue"); + } +#else + if (result < 0) + { + ThrowHelper.ThrowWin32Exception(result); + } +#endif + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12DeviceExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12DeviceExtensions.cs new file mode 100644 index 00000000..c9ae84e9 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12DeviceExtensions.cs @@ -0,0 +1,586 @@ +using System; +using System.Diagnostics.Contracts; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Graphics.Helpers; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_COMMAND_QUEUE_FLAGS; +using static TerraFX.Interop.D3D12_COMMAND_QUEUE_PRIORITY; +using static TerraFX.Interop.D3D12_CPU_PAGE_PROPERTY; +using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_FLAGS; +using static TerraFX.Interop.D3D12_DESCRIPTOR_HEAP_TYPE; +using static TerraFX.Interop.D3D12_FEATURE; +using static TerraFX.Interop.D3D12_FENCE_FLAGS; +using static TerraFX.Interop.D3D12_MEMORY_POOL; +using static TerraFX.Interop.D3D12_MESSAGE_ID; +using static TerraFX.Interop.D3D12_HEAP_TYPE; +using static TerraFX.Interop.D3D12_RESOURCE_FLAGS; +using static TerraFX.Interop.D3D12_RESOURCE_STATES; +using static TerraFX.Interop.D3D12_SRV_DIMENSION; +using static TerraFX.Interop.D3D12_UAV_DIMENSION; +using FX = TerraFX.Interop.Windows; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +namespace ComputeSharp.Graphics.Extensions +{ + /// + /// A with extensions for the type. + /// + internal static unsafe class ID3D12DeviceExtensions + { + /// + /// Creates a new for a given device. + /// + /// The target to use to create the info queue. + /// A pointer to the newly created instance. + /// Thrown when the creation of the info queue fails. + public static ComPtr CreateInfoQueue(this ref ID3D12Device d3D12Device) + { + ComPtr d3D12InfoQueue = default; + + d3D12Device.QueryInterface(FX.__uuidof(), d3D12InfoQueue.GetVoidAddressOf()).Assert(); + + D3D12_MESSAGE_ID* d3D12MessageIds = stackalloc D3D12_MESSAGE_ID[3] + { + D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS, + D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE, + D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE + }; + + D3D12_INFO_QUEUE_FILTER d3D12InfoQueueFilter = default; + d3D12InfoQueueFilter.DenyList.NumIDs = 3; + d3D12InfoQueueFilter.DenyList.pIDList = d3D12MessageIds; + + d3D12InfoQueue.Get()->PushRetrievalFilter(&d3D12InfoQueueFilter).Assert(); + + return d3D12InfoQueue.Move(); + } + + /// + /// Creates a new of the specified type, for a given device. + /// + /// The target to use to create the command queue. + /// The type of command queue to create. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command queue fails. + public static ComPtr CreateCommandQueue(this ref ID3D12Device d3D12Device, D3D12_COMMAND_LIST_TYPE type) + { + using ComPtr d3D12CommandQueue = default; + + D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; + d3D12CommandQueueDesc.Type = type; + d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; + d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; + d3D12CommandQueueDesc.NodeMask = 0; + + d3D12Device.CreateCommandQueue( + &d3D12CommandQueueDesc, + FX.__uuidof(), + d3D12CommandQueue.GetVoidAddressOf()).Assert(); + + return d3D12CommandQueue.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the fence. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command queue fails. + public static ComPtr CreateFence(this ref ID3D12Device d3D12Device) + { + using ComPtr d3D12Fence = default; + + d3D12Device.CreateFence( + 0, + D3D12_FENCE_FLAG_NONE, + FX.__uuidof(), + d3D12Fence.GetVoidAddressOf()).Assert(); + + return d3D12Fence.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the descriptor heap. + /// The number of descriptors to allocate. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command queue fails. + public static ComPtr CreateDescriptorHeap(this ref ID3D12Device d3D12Device, uint descriptorsCount) + { + using ComPtr d3D12DescriptorHeap = default; + + D3D12_DESCRIPTOR_HEAP_DESC d3D12DescriptorHeapDesc; + d3D12DescriptorHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV; + d3D12DescriptorHeapDesc.NumDescriptors = descriptorsCount; + d3D12DescriptorHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; + d3D12DescriptorHeapDesc.NodeMask = 0; + + d3D12Device.CreateDescriptorHeap( + &d3D12DescriptorHeapDesc, + FX.__uuidof(), + d3D12DescriptorHeap.GetVoidAddressOf()).Assert(); + + return d3D12DescriptorHeap.Move(); + } + + /// + /// Creates a committed resource for a given buffer type. + /// + /// The instance in use. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The size in bytes of the current buffer. + /// Indicates whether or not the current device has a cache coherent UMA architecture. + /// An reference for the current buffer. + public static ComPtr CreateCommittedResource( + this ref ID3D12Device d3D12Device, + ResourceType resourceType, + AllocationMode allocationMode, + ulong sizeInBytes, + bool isCacheCoherentUMA) + { + (D3D12_HEAP_TYPE d3D12HeapType, + D3D12_RESOURCE_FLAGS d3D12ResourceFlags, + D3D12_RESOURCE_STATES d3D12ResourceStates) = resourceType switch + { + ResourceType.Constant => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), + ResourceType.ReadOnly => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadBack => (D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST), + ResourceType.Upload => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ), + _ => ThrowHelper.ThrowArgumentException<(D3D12_HEAP_TYPE, D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; + + using ComPtr d3D12Resource = default; + + D3D12_HEAP_PROPERTIES d3D12HeapProperties; + d3D12HeapProperties.CreationNodeMask = 1; + d3D12HeapProperties.VisibleNodeMask = 1; + + if (isCacheCoherentUMA) + { + d3D12HeapProperties.Type = D3D12_HEAP_TYPE_CUSTOM; + d3D12HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_WRITE_BACK; + d3D12HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_L0; + } + else + { + d3D12HeapProperties.Type = d3D12HeapType; + d3D12HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; + d3D12HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN; + } + + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Buffer(sizeInBytes, d3D12ResourceFlags); + + d3D12Device.CreateCommittedResource( + &d3D12HeapProperties, + D3D12FeatureHelper.GetD3D12HeapFlags(allocationMode), + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + FX.__uuidof(), + d3D12Resource.GetVoidAddressOf()).Assert(); + + return d3D12Resource.Move(); + } + + /// + /// Creates a committed resource for a given 2D texture type. + /// + /// The instance in use. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// Indicates whether or not the current device has a cache coherent UMA architecture. + /// The default value for the resource. + /// An reference for the current texture. + public static ComPtr CreateCommittedResource( + this ref ID3D12Device d3D12Device, + ResourceType resourceType, + AllocationMode allocationMode, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + bool isCacheCoherentUMA, + out D3D12_RESOURCE_STATES d3D12ResourceStates) + { + D3D12_RESOURCE_FLAGS d3D12ResourceFlags; + + (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch + { + ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), + _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; + + using ComPtr d3D12Resource = default; + + D3D12_HEAP_PROPERTIES d3D12HeapProperties; + d3D12HeapProperties.CreationNodeMask = 1; + d3D12HeapProperties.VisibleNodeMask = 1; + + if (isCacheCoherentUMA) + { + d3D12HeapProperties.Type = D3D12_HEAP_TYPE_CUSTOM; + d3D12HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_WRITE_BACK; + d3D12HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_L0; + } + else + { + d3D12HeapProperties.Type = D3D12_HEAP_TYPE_DEFAULT; + d3D12HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; + d3D12HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN; + } + + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex2D(dxgiFormat, width, height, mipLevels: 1, flags: d3D12ResourceFlags); + + d3D12Device.CreateCommittedResource( + &d3D12HeapProperties, + D3D12FeatureHelper.GetD3D12HeapFlags(allocationMode), + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + FX.__uuidof(), + d3D12Resource.GetVoidAddressOf()).Assert(); + + return d3D12Resource.Move(); + } + + /// + /// Creates a committed resource for a given 3D texture type. + /// + /// The instance in use. + /// The resource type currently in use. + /// The allocation mode to use for the new resource. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The depth of the texture resource. + /// Indicates whether or not the current device has a cache coherent UMA architecture. + /// The default value for the resource. + /// An reference for the current texture. + public static ComPtr CreateCommittedResource( + this ref ID3D12Device d3D12Device, + ResourceType resourceType, + AllocationMode allocationMode, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + ushort depth, + bool isCacheCoherentUMA, + out D3D12_RESOURCE_STATES d3D12ResourceStates) + { + D3D12_RESOURCE_FLAGS d3D12ResourceFlags; + + (d3D12ResourceFlags, d3D12ResourceStates) = resourceType switch + { + ResourceType.ReadOnly => (D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON), + ResourceType.ReadWrite => (D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_UNORDERED_ACCESS), + _ => ThrowHelper.ThrowArgumentException<(D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>() + }; + + using ComPtr d3D12Resource = default; + + D3D12_HEAP_PROPERTIES d3D12HeapProperties; + d3D12HeapProperties.CreationNodeMask = 1; + d3D12HeapProperties.VisibleNodeMask = 1; + + if (isCacheCoherentUMA) + { + d3D12HeapProperties.Type = D3D12_HEAP_TYPE_CUSTOM; + d3D12HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_WRITE_BACK; + d3D12HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_L0; + } + else + { + d3D12HeapProperties.Type = D3D12_HEAP_TYPE_DEFAULT; + d3D12HeapProperties.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; + d3D12HeapProperties.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN; + } + + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex3D(dxgiFormat, width, height, depth, mipLevels: 1, flags: d3D12ResourceFlags); + + d3D12Device.CreateCommittedResource( + &d3D12HeapProperties, + D3D12FeatureHelper.GetD3D12HeapFlags(allocationMode), + &d3D12ResourceDescription, + d3D12ResourceStates, + null, + FX.__uuidof(), + d3D12Resource.GetVoidAddressOf()).Assert(); + + return d3D12Resource.Move(); + } + + /// + /// Creates a view for a constant buffer. + /// + /// The target instance in use. + /// The to create a view for. + /// The size of the target resource. + /// The instance for the current resource. + public static void CreateConstantBufferView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + nint bufferSize, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + uint constantBufferSize = checked((uint)((bufferSize + 255) & ~255)); + + D3D12_CONSTANT_BUFFER_VIEW_DESC d3D12ConstantBufferViewDescription; + d3D12ConstantBufferViewDescription.BufferLocation = d3D12Resource->GetGPUVirtualAddress(); + d3D12ConstantBufferViewDescription.SizeInBytes = constantBufferSize; + + d3D12Device.CreateConstantBufferView(&d3D12ConstantBufferViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a readonly buffer. + /// + /// The target instance in use. + /// The to create a view for. + /// The size of the target resource. + /// The size in byte of each item in the resource. + /// The instance for the current resource. + public static void CreateShaderResourceView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + uint bufferSize, + uint elementSize, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default; + d3D12ShaderResourceViewDescription.ViewDimension = D3D12_SRV_DIMENSION_BUFFER; + d3D12ShaderResourceViewDescription.Shader4ComponentMapping = FX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + d3D12ShaderResourceViewDescription.Buffer.NumElements = bufferSize; + d3D12ShaderResourceViewDescription.Buffer.StructureByteStride = elementSize; + + d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a readonly texture. + /// + /// The target instance in use. + /// The to create a view for. + /// The value to use. + /// The value for the view to create. + /// The instance for the current resource. + public static void CreateShaderResourceView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + DXGI_FORMAT dxgiFormat, + D3D12_SRV_DIMENSION d3D12SrvDimension, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default; + d3D12ShaderResourceViewDescription.ViewDimension = d3D12SrvDimension; + d3D12ShaderResourceViewDescription.Format = dxgiFormat; + d3D12ShaderResourceViewDescription.Shader4ComponentMapping = FX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + d3D12ShaderResourceViewDescription.Texture2D.MipLevels = uint.MaxValue; + + d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a buffer that can be both read and written to. + /// + /// The target instance in use. + /// The to create a view for. + /// The size of the target resource. + /// The size in byte of each item in the resource. + /// The instance for the current resource. + public static void CreateUnorderedAccessView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + uint bufferSize, + uint elementSize, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_UNORDERED_ACCESS_VIEW_DESC d3D12UnorderedAccessViewDescription = default; + d3D12UnorderedAccessViewDescription.ViewDimension = D3D12_UAV_DIMENSION_BUFFER; + d3D12UnorderedAccessViewDescription.Buffer.NumElements = bufferSize; + d3D12UnorderedAccessViewDescription.Buffer.StructureByteStride = elementSize; + + d3D12Device.CreateUnorderedAccessView(d3D12Resource, null, &d3D12UnorderedAccessViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a view for a texture that can be both read and written to. + /// + /// The target instance in use. + /// The to create a view for. + /// The value to use. + /// The value for the view to create. + /// The instance for the current resource. + public static void CreateUnorderedAccessView( + this ref ID3D12Device d3D12Device, + ID3D12Resource* d3D12Resource, + DXGI_FORMAT dxgiFormat, + D3D12_UAV_DIMENSION d3D12UavDimension, + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle) + { + D3D12_UNORDERED_ACCESS_VIEW_DESC d3D12UnorderedAccessViewDescription = default; + d3D12UnorderedAccessViewDescription.ViewDimension = d3D12UavDimension; + d3D12UnorderedAccessViewDescription.Format = dxgiFormat; + d3D12UnorderedAccessViewDescription.Texture3D.WSize = uint.MaxValue; + + d3D12Device.CreateUnorderedAccessView(d3D12Resource, null, &d3D12UnorderedAccessViewDescription, d3D12CpuDescriptorHandle); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the command allocator. + /// The type of command list allocator to create. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command allocator fails. + public static ComPtr CreateCommandAllocator( + this ref ID3D12Device d3D12Device, + D3D12_COMMAND_LIST_TYPE d3D12CommandListType) + { + using ComPtr d3D12CommandAllocator = default; + + d3D12Device.CreateCommandAllocator( + d3D12CommandListType, + FX.__uuidof(), + d3D12CommandAllocator.GetVoidAddressOf()).Assert(); + + return d3D12CommandAllocator.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the command list. + /// The type of command list to create. + /// The command allocator to use to create the command list. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the command list fails. + public static ComPtr CreateCommandList( + this ref ID3D12Device d3D12Device, + D3D12_COMMAND_LIST_TYPE d3D12CommandListType, + ID3D12CommandAllocator* d3D12CommandAllocator) + { + using ComPtr d3D12GraphicsCommandList = default; + + d3D12Device.CreateCommandList( + 0, + d3D12CommandListType, + d3D12CommandAllocator, + null, + FX.__uuidof(), + d3D12GraphicsCommandList.GetVoidAddressOf()).Assert(); + + return d3D12GraphicsCommandList.Move(); + } + + /// + /// Gets the layout data for a target resource. + /// + /// The target to use to get the layout info. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The resulting layout info for the resource. + /// The size in bytes of each row in the resource. + /// The total number of bytes for the resource. + public static void GetCopyableFootprint( + this ref ID3D12Device d3D12Device, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes) + { + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex2D(dxgiFormat, width, height); + ulong a, b; + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* p = &d3D12PlacedSubresourceFootprint) + { + uint _; + + d3D12Device.GetCopyableFootprints(&d3D12ResourceDescription, 0, 1, 0, p, &_, &a, &b); + } + + rowSizeInBytes = a; + totalSizeInBytes = b; + } + + /// + /// Gets the layout data for a target resource. + /// + /// The target to use to get the layout info. + /// The value to use. + /// The width of the texture resource. + /// The height of the texture resource. + /// The depth of the texture resource. + /// The resulting layout info for the resource. + /// The size in bytes of each row in the resource. + /// The total number of bytes for the resource. + public static void GetCopyableFootprint( + this ref ID3D12Device d3D12Device, + DXGI_FORMAT dxgiFormat, + uint width, + uint height, + ushort depth, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes) + { + D3D12_RESOURCE_DESC d3D12ResourceDescription = D3D12_RESOURCE_DESC.Tex3D(dxgiFormat, width, height, depth); + ulong a, b; + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* p = &d3D12PlacedSubresourceFootprint) + { + uint _; + + d3D12Device.GetCopyableFootprints(&d3D12ResourceDescription, 0, 1, 0, p, &_, &a, &b); + } + + rowSizeInBytes = a; + totalSizeInBytes = b; + } + + /// + /// Checks the feature support of a given type for a given device. + /// + /// The type of feature support data to retrieve. + /// The target to use to check features for. + /// The type of features to check. + /// A value with the features data. + [Pure] + public static unsafe TFeature CheckFeatureSupport(this ref ID3D12Device d3D12Device, D3D12_FEATURE d3D12Feature) + where TFeature : unmanaged + { + TFeature feature = default; + + d3D12Device.CheckFeatureSupport(d3D12Feature, &feature, (uint)sizeof(TFeature)).Assert(); + + return feature; + } + + /// + /// Checks whether or not a given DXGI format is supported for the specified resource type. + /// + /// The target to use to check features for. + /// The type to check support for. + /// The resource type to check support for. + /// Whether or not the input device supports the requested format for the specified resource type. + [Pure] + public static unsafe bool IsDxgiFormatSupported(this ref ID3D12Device d3D12Device, DXGI_FORMAT dxgiFormat, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport1) + { + D3D12_FEATURE_DATA_FORMAT_SUPPORT d3D12FeatureDataFormatSupport = default; + d3D12FeatureDataFormatSupport.Format = dxgiFormat; + + d3D12Device.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &d3D12FeatureDataFormatSupport, (uint)sizeof(D3D12_FEATURE_DATA_FORMAT_SUPPORT)).Assert(); + + return (d3D12FeatureDataFormatSupport.Support1 & d3D12FormatSupport1) == d3D12FormatSupport1; + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12GraphicsCommandListExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12GraphicsCommandListExtensions.cs new file mode 100644 index 00000000..04d8fb1a --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12GraphicsCommandListExtensions.cs @@ -0,0 +1,161 @@ +using System; +using TerraFX.Interop; + +namespace ComputeSharp.Graphics.Extensions +{ + /// + /// A with extensions for the type. + /// + internal static unsafe class ID3D12GraphicsCommandListExtensions + { + /// + /// Copies a texture memory region from one resource (a texture) to another (a buffer). + /// + /// The instance in use. + /// The destination (a buffer) to write to. + /// The value describing . + /// The horizontal offset in the destination buffer. + /// The vertical offset in the destination buffer. + /// The depthwise offset in the destination buffer. + /// The source (a texture) to read from. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to read from. + /// The height of the memory area to read from. + /// The depth of the memory area to read from. + public static void CopyTextureRegion( + this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, + ID3D12Resource* d3D12ResourceDestination, + D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination, + uint destinationX, + uint destinationY, + ushort destinationZ, + ID3D12Resource* d3D12ResourceSource, + uint sourceX, + uint sourceY, + ushort sourceZ, + uint width, + uint height, + ushort depth) + { + D3D12_RESOURCE_DESC d3D12ResourceDescriptionSource = d3D12ResourceSource->GetDesc(); + D3D12_TEXTURE_COPY_LOCATION + d3D12TextureCopyLocationDestination = new(d3D12ResourceDestination, in *d3D12PlacedSubresourceFootprintDestination), + d3D12TextureCopyLocationSource = new(d3D12ResourceSource, 0); + D3D12_BOX d3D12Box; + D3D12_BOX* pD3D12Box; + + if (sourceX == 0 && sourceY == 0 && sourceZ == 0 && + width == d3D12ResourceDescriptionSource.Width && + height == d3D12ResourceDescriptionSource.Height && + depth == d3D12ResourceDescriptionSource.Depth) + { + pD3D12Box = null; + } + else + { + d3D12Box = new D3D12_BOX((int)sourceX, (int)sourceY, sourceZ, (int)(sourceX + width), (int)(sourceY + height), sourceZ + depth); + pD3D12Box = &d3D12Box; + } + + d3D12GraphicsCommandList.CopyTextureRegion( + &d3D12TextureCopyLocationDestination, + destinationX, + destinationY, + destinationZ, + &d3D12TextureCopyLocationSource, + pD3D12Box); + } + + /// + /// Copies a texture memory region from one resource (a buffer) to another (a texture). + /// + /// The instance in use. + /// The destination (a texture) to write to. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The source (a buffer) to read from. + /// The value describing . + /// The horizontal offset in the source buffer. + /// The vertical offset in the source buffer. + /// The depthwise offset in the source buffer. + /// The width of the memory area to read from. + /// The height of the memory area to read from. + /// The depth of the memory area to read from. + public static void CopyTextureRegion( + this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, + ID3D12Resource* d3D12ResourceDestination, + uint destinationX, + uint destinationY, + ushort destinationZ, + ID3D12Resource* d3D12ResourceSource, + D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource, + uint sourceX, + uint sourceY, + ushort sourceZ, + uint width, + uint height, + ushort depth) + { + D3D12_TEXTURE_COPY_LOCATION + d3D12TextureCopyLocationDestination = new(d3D12ResourceDestination, 0), + d3D12TextureCopyLocationSource = new(d3D12ResourceSource, in *d3D12PlacedSubresourceFootprintSource); + D3D12_BOX d3D12Box; + D3D12_BOX* pD3D12Box; + + if (sourceX == 0 && sourceY == 0 && sourceZ == 0 && + width == d3D12PlacedSubresourceFootprintSource->Footprint.Width && + height == d3D12PlacedSubresourceFootprintSource->Footprint.Height && + depth == d3D12PlacedSubresourceFootprintSource->Footprint.Depth) + { + pD3D12Box = null; + } + else + { + d3D12Box = new D3D12_BOX((int)sourceX, (int)sourceY, sourceZ, (int)(sourceX + width), (int)(sourceY + height), sourceZ + depth); + pD3D12Box = &d3D12Box; + } + + d3D12GraphicsCommandList.CopyTextureRegion( + &d3D12TextureCopyLocationDestination, + destinationX, + destinationY, + destinationZ, + &d3D12TextureCopyLocationSource, + pD3D12Box); + } + + /// + /// Creates a resource barrier to transition a resource to a specific state. + /// + /// The instance in use. + /// The to change state for. + /// The starting value for the transition. + /// The destnation value for the transition. + public static void ResourceBarrier( + this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, + ID3D12Resource* d3D12Resource, + D3D12_RESOURCE_STATES d3D12ResourceStatesBefore, + D3D12_RESOURCE_STATES d3D12ResourceStatesAfter) + { + D3D12_RESOURCE_BARRIER d3D12ResourceBarrier = D3D12_RESOURCE_BARRIER.InitTransition(d3D12Resource, d3D12ResourceStatesBefore, d3D12ResourceStatesAfter); + + d3D12GraphicsCommandList.ResourceBarrier(1, &d3D12ResourceBarrier); + } + + /// + /// Binds an input constant buffer to the first root parameter. + /// + /// The instance in use. + /// The input buffer with the constant data to bind. + public static void SetComputeRoot32BitConstants(this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, ReadOnlySpan data) + { + fixed (uint* p = data) + { + d3D12GraphicsCommandList.SetComputeRoot32BitConstants(0, (uint)data.Length, p, 0); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12ResourceExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12ResourceExtensions.cs new file mode 100644 index 00000000..3995f71e --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Interop/ID3D12ResourceExtensions.cs @@ -0,0 +1,60 @@ +using System; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Graphics.Resources.Interop; +using TerraFX.Interop; + +namespace ComputeSharp.Graphics.Extensions +{ + /// + /// A with extensions for the type. + /// + internal static unsafe class ID3D12ResourceExtensions + { + /// + /// Maps the current resource to a specified subresource. + /// + /// The target to map. + /// A instance representing the mapped resource. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ID3D12ResourceMap Map(this ref ID3D12Resource d3D12Resource) + { + void* pointer; + + d3D12Resource.Map(0, null, &pointer).Assert(); + + return new((ID3D12Resource*)Unsafe.AsPointer(ref d3D12Resource), pointer); + } + + /// + /// Maps a given memory area. + /// + /// The target to map. + /// A pointer to the mapped area for . + /// Thrown when the mapping operation fails. + /// Only use this method to unmap resources that were mapped with . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Unmap(this ref ID3D12Resource d3D12Resource) + { + d3D12Resource.Unmap(0, null); + } + + /// + /// Assigns a name to a given . + /// + /// The target to map. + /// The wrapper object to get the name from. + /// Thrown when the mapping operation fails. + [Conditional("DEBUG")] + public static void SetName(this ref ID3D12Resource d3D12Resource, object wrapper) + { + string name = wrapper.ToString()!; + + fixed (char* p = name) + { + d3D12Resource.SetName((ushort*)p).Assert(); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/StructuredBufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/StructuredBufferExtensions.cs new file mode 100644 index 00000000..90288139 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/StructuredBufferExtensions.cs @@ -0,0 +1,37 @@ +using ComputeSharp.Resources; + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type. + /// + public static class StructuredBufferExtensions + { + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this StructuredBuffer buffer, ReadBackBuffer destination) + where T : unmanaged + { + buffer.CopyTo(destination, 0, buffer.Length, 0); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + /// The starting offset within to write data to. + /// The offset to start reading data from. + /// The number of items to read. + public static void CopyTo(this StructuredBuffer buffer, ReadBackBuffer destination, int destinationOffset, int bufferOffset, int count) + where T : unmanaged + { + buffer.CopyTo(destination, destinationOffset, count, bufferOffset); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/System.Numerics/FloatExtensions.cs b/src/ComputeSharp/Graphics/Extensions/System.Numerics/FloatExtensions.cs new file mode 100644 index 00000000..0a35af0a --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/System.Numerics/FloatExtensions.cs @@ -0,0 +1,84 @@ +using System.Diagnostics.Contracts; +using ComputeSharp; +using static System.Runtime.InteropServices.MemoryMarshal; + +namespace System.Numerics +{ + /// + /// A that contains extension methods for the , and types. + /// + public static class FloatExtensions + { + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsVector2Span(this Float2[] array) => Cast(array); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsVector2Span(this ReadOnlySpan span) => Cast(span); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsVector2Span(this Span span) => Cast(span); + + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsVector3Span(this Float3[] array) => Cast(array); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsVector3Span(this ReadOnlySpan span) => Cast(span); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsVector3Span(this Span span) => Cast(span); + + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsVector4Span(this Float4[] array) => Cast(array); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsVector4Span(this ReadOnlySpan span) => Cast(span); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsVector4Span(this Span span) => Cast(span); + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/System.Numerics/VectorExtensions.cs b/src/ComputeSharp/Graphics/Extensions/System.Numerics/VectorExtensions.cs new file mode 100644 index 00000000..ea8c6da2 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/System.Numerics/VectorExtensions.cs @@ -0,0 +1,84 @@ +using System.Diagnostics.Contracts; +using ComputeSharp; +using static System.Runtime.InteropServices.MemoryMarshal; + +namespace System.Numerics +{ + /// + /// A that contains extension methods for the , and types. + /// + public static class VectorExtensions + { + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsFloat2Span(this Vector2[] array) => Cast(array); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsFloat2Span(this ReadOnlySpan span) => Cast(span); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsFloat2Span(this Span span) => Cast(span); + + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsFloat3Span(this Vector3[] array) => Cast(array); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsFloat3Span(this ReadOnlySpan span) => Cast(span); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsFloat3Span(this Span span) => Cast(span); + + /// + /// Converts a array into a with items of type . + /// + /// The input array. + /// A with items of type , mapping the original array. + [Pure] + public static Span AsFloat4Span(this Vector4[] array) => Cast(array); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static ReadOnlySpan AsFloat4Span(this ReadOnlySpan span) => Cast(span); + + /// + /// Converts a into a with items of type . + /// + /// The input . + /// A with items of type , mapping the original . + [Pure] + public static Span AsFloat4Span(this Span span) => Cast(span); + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Texture2DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Texture2DExtensions.cs new file mode 100644 index 00000000..db6722f8 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Texture2DExtensions.cs @@ -0,0 +1,342 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; +using ComputeSharp.Resources; +using Microsoft.Toolkit.Diagnostics; + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type. + /// + public static class Texture2DExtensions + { + /// + /// Reads the contents of the current instance and returns an array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// A array with the contents of the current texture. + [Pure] + public static T[,] ToArray(this Texture2D texture) + where T : unmanaged + { + T[,] data = new T[texture.Height, texture.Width]; + + texture.CopyTo(data); + + return data; + } + + /// + /// Reads the contents of the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + public static void CopyTo(this Texture2D texture, T[,] destination) + where T : unmanaged + { + Guard.IsEqualTo(destination.GetLength(0), texture.Height, nameof(destination)); + Guard.IsEqualTo(destination.GetLength(1), texture.Width, nameof(destination)); + + texture.CopyTo(ref destination[0, 0], destination.Length, 0, 0, texture.Width, texture.Height); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + public static void CopyTo(this Texture2D texture, T[] destination) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(), 0, 0, texture.Width, texture.Height); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + public static void CopyTo(this Texture2D texture, T[] destination, Range x, Range y) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(), x, y); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, T[] destination, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(), x, y, width, height); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + public static void CopyTo(this Texture2D texture, T[] destination, int offset) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), 0, 0, texture.Width, texture.Height); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + public static void CopyTo(this Texture2D texture, T[] destination, int offset, Range x, Range y) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, T[] destination, int offset, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y, width, height); + } + + /// + /// Reads the contents of the current instance and writes them into a target . + /// The input data will be read from the start of the texture. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + public static void CopyTo(this Texture2D texture, Span destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, texture.Width, texture.Height); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + public static void CopyTo(this Texture2D texture, Span destination, Range x, Range y) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + + texture.CopyTo(destination, offsetX, offsetY, width, height); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, Span destination, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, x, y, width, height); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this Texture2D texture, ReadBackTexture2D destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, 0, texture.Width, texture.Height); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this Texture2D texture, ReadBackTexture2D destination, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, x, y, width, height); + } + + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + public static unsafe void CopyFrom(this Texture2D texture, T[,] source) + where T : unmanaged + { + Guard.IsEqualTo(source.GetLength(0), texture.Height, nameof(source)); + Guard.IsEqualTo(source.GetLength(1), texture.Width, nameof(source)); + + texture.CopyFrom(ref source[0, 0], source.Length, 0, 0, texture.Width, texture.Height); + } + + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + public static void CopyFrom(this Texture2D texture, T[] source) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), 0, 0, texture.Width, texture.Height); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + public static void CopyFrom(this Texture2D texture, T[] source, Range x, Range y) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + public static void CopyFrom(this Texture2D texture, T[] source, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y, width, height); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + public static void CopyFrom(this Texture2D texture, T[] source, int offset, Range x, Range y) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + public static void CopyFrom(this Texture2D texture, T[] source, int offset, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y, width, height); + } + + /// + /// Writes the contents of a given to the current instance. + /// The input data will be written to the start of the texture, and all input items will be copied. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + public static void CopyFrom(this Texture2D texture, ReadOnlySpan source) + where T : unmanaged + { + texture.CopyFrom(source, 0, 0, texture.Width, texture.Height); + } + + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + public static void CopyFrom(this Texture2D texture, ReadOnlySpan source, Range x, Range y) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + + texture.CopyFrom(source, offsetX, offsetY, width, height); + } + + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + public static void CopyFrom(this Texture2D texture, ReadOnlySpan source, int x, int y, int width, int height) + where T : unmanaged + { + texture.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, x, y, width, height); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/Texture3DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Texture3DExtensions.cs new file mode 100644 index 00000000..83c0837d --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/Texture3DExtensions.cs @@ -0,0 +1,333 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; +using ComputeSharp.Resources; +using Microsoft.Toolkit.Diagnostics; + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type. + /// + public static class Texture3DExtensions + { + /// + /// Reads the contents of the current instance and returns an array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// A array with the contents of the current buffer. + /// + /// The returned array will be using the same memory layout as the texture, that is, each 2D plane + /// in the 3D volume represented by the texture is contiguous in memory, and planes are stacked in + /// the depth dimension. This means that the resulting 3D array will have a size of [D, H, W]. + /// + [Pure] + public static T[,,] ToArray(this Texture3D texture) + where T : unmanaged + { + T[,,] data = new T[texture.Depth, texture.Height, texture.Width]; + + texture.CopyTo(data); + + return data; + } + + /// + /// Reads the contents of the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// + /// The input 3D array needs to have each 2D plane stacked on the depth axis. That is, the expected + /// layout of the input array has to be of shape [depth, height, width]. + /// + public static void CopyTo(this Texture3D texture, T[,,] destination) + where T : unmanaged + { + Guard.IsEqualTo(destination.GetLength(0), texture.Depth, nameof(destination)); + Guard.IsEqualTo(destination.GetLength(1), texture.Height, nameof(destination)); + Guard.IsEqualTo(destination.GetLength(2), texture.Width, nameof(destination)); + + texture.CopyTo(ref destination[0, 0, 0], destination.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + public static void CopyTo(this Texture3D texture, T[] destination, int offset) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal range of items to copy. + /// The vertical range of items to copy. + /// The depthwise range of items to copy. + public static void CopyTo(this Texture3D texture, T[] destination, int offset, Range x, Range y, Range z) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y, z); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target array. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input array to write data to. + /// The starting offset within to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this Texture3D texture, T[] destination, int offset, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyTo(destination.AsSpan(offset), x, y, z, width, height, depth); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + public static void CopyTo(this Texture3D texture, Span destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal range in the source texture. + /// The vertical range in the source texture. + /// The depthwise range in the source texture. + public static void CopyTo(this Texture3D texture, Span destination, Range x, Range y, Range z) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + var (offsetZ, depth) = z.GetOffsetAndLength(texture.Depth); + + texture.CopyTo(destination, offsetX, offsetY, offsetZ, width, height, depth); + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target . + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The input to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this Texture3D texture, Span destination, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyTo(ref MemoryMarshal.GetReference(destination), destination.Length, x, y, z, width, height, depth); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this Texture3D texture, ReadBackTexture3D destination) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this Texture3D texture, ReadBackTexture3D destination, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyTo(destination, 0, 0, 0, x, y, z, width, height, depth); + } + + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// + /// The source 3D array needs to have each 2D plane stacked on the depth axis. That is, the expected + /// layout of the input array has to be of shape [depth, height, width]. + /// + public static void CopyFrom(this Texture3D texture, T[,,] source) + where T : unmanaged + { + Guard.IsEqualTo(source.GetLength(0), texture.Depth, nameof(source)); + Guard.IsEqualTo(source.GetLength(1), texture.Height, nameof(source)); + Guard.IsEqualTo(source.GetLength(2), texture.Width, nameof(source)); + + texture.CopyFrom(ref source[0, 0, 0], source.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Writes the contents of a given array to the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + public static void CopyFrom(this Texture3D texture, T[] source) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + /// The depthwise range of items to write. + public static void CopyFrom(this Texture3D texture, T[] source, Range x, Range y, Range z) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y, z); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + public static void CopyFrom(this Texture3D texture, T[] source, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(), x, y, z, width, height, depth); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + /// The depthwise range of items to write. + public static void CopyFrom(this Texture3D texture, T[] source, int offset, Range x, Range y, Range z) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y, z); + } + + /// + /// Writes the contents of a given array to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input array to read data from. + /// The starting offset within to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + public static void CopyFrom(this Texture3D texture, T[] source, int offset, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyFrom(source.AsSpan(offset), x, y, z, width, height, depth); + } + + /// + /// Writes the contents of a given to the current instance. + /// The input data will be written to the start of the texture, and all input items will be copied. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + public static void CopyFrom(this Texture3D texture, ReadOnlySpan source) + where T : unmanaged + { + texture.CopyFrom(source, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal range of items to write. + /// The vertical range of items to write. + /// The depthwise range of items to write. + public static void CopyFrom(this Texture3D texture, ReadOnlySpan source, Range x, Range y, Range z) + where T : unmanaged + { + var (offsetX, width) = x.GetOffsetAndLength(texture.Width); + var (offsetY, height) = y.GetOffsetAndLength(texture.Height); + var (offsetZ, depth) = z.GetOffsetAndLength(texture.Depth); + + texture.CopyFrom(source, offsetX, offsetY, offsetZ, width, height, depth); + } + + /// + /// Writes the contents of a given to a specified area of the current instance. + /// + /// The type of items stored on the texture. + /// The target instance to write data to. + /// The input to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offseet in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + public static void CopyFrom(this Texture3D texture, ReadOnlySpan source, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + texture.CopyFrom(ref MemoryMarshal.GetReference(source), source.Length, x, y, z, width, height, depth); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/UploadBufferExtensions.cs b/src/ComputeSharp/Graphics/Extensions/UploadBufferExtensions.cs new file mode 100644 index 00000000..113b1c43 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/UploadBufferExtensions.cs @@ -0,0 +1,37 @@ +using ComputeSharp.Resources; + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type. + /// + public static class UploadBufferExtensions + { + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this UploadBuffer buffer, StructuredBuffer destination) + where T : unmanaged + { + destination.CopyFrom(buffer, 0, buffer.Length, 0); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the buffer. + /// The input instance to read data from. + /// The target instance to write data to. + /// The starting offset within to write data to. + /// The offset to start reading data from. + /// The number of items to read. + public static void CopyTo(this UploadBuffer buffer, StructuredBuffer destination, int destinationOffset, int bufferOffset, int count) + where T : unmanaged + { + destination.CopyFrom(buffer, bufferOffset, count, destinationOffset); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/UploadTexture2DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/UploadTexture2DExtensions.cs new file mode 100644 index 00000000..5b95c66b --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/UploadTexture2DExtensions.cs @@ -0,0 +1,38 @@ +using ComputeSharp.Resources; + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type. + /// + public static class UploadTexture2DExtensions + { + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this UploadTexture2D texture, Texture2D destination) + where T : unmanaged + { + destination.CopyFrom(texture, 0, 0, 0, 0, texture.Width, texture.Height); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + public static void CopyTo(this UploadTexture2D texture, Texture2D destination, int x, int y, int width, int height) + where T : unmanaged + { + destination.CopyFrom(texture, x, y, 0, 0, width, height); + } + } +} diff --git a/src/ComputeSharp/Graphics/Extensions/UploadTexture3DExtensions.cs b/src/ComputeSharp/Graphics/Extensions/UploadTexture3DExtensions.cs new file mode 100644 index 00000000..d5e42e85 --- /dev/null +++ b/src/ComputeSharp/Graphics/Extensions/UploadTexture3DExtensions.cs @@ -0,0 +1,40 @@ +using ComputeSharp.Resources; + +namespace ComputeSharp +{ + /// + /// A that contains extension methods for the type. + /// + public static class UploadTexture3DExtensions + { + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + public static void CopyTo(this UploadTexture3D texture, Texture3D destination) + where T : unmanaged + { + destination.CopyFrom(texture, 0, 0, 0, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + } + + /// + /// Reads the contents of a instance and writes them into a target instance. + /// + /// The type of items stored on the texture. + /// The input instance to read data from. + /// The target instance to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + public static void CopyTo(this UploadTexture3D texture, Texture3D destination, int x, int y, int z, int width, int height, int depth) + where T : unmanaged + { + destination.CopyFrom(texture, x, y, z, 0, 0, 0, width, height, depth); + } + } +} diff --git a/src/ComputeSharp/Graphics/GraphicsDevice.cs b/src/ComputeSharp/Graphics/GraphicsDevice.cs new file mode 100644 index 00000000..affde884 --- /dev/null +++ b/src/ComputeSharp/Graphics/GraphicsDevice.cs @@ -0,0 +1,353 @@ +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Graphics.Commands; +using ComputeSharp.Graphics.Commands.Interop; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Graphics.Helpers; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; +using static TerraFX.Interop.D3D12_FEATURE; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; +using static TerraFX.Interop.DXGI_ADAPTER_FLAG; + +namespace ComputeSharp +{ + /// + /// A that represents a DX12-compatible GPU device that can be used to run compute shaders. + /// + [DebuggerDisplay("{ToString(),raw}")] + public sealed unsafe class GraphicsDevice : NativeObject + { + /// + /// The underlying wrapped by the current instance. + /// + private ComPtr d3D12Device; + + /// + /// The instance to use for compute operations. + /// + private ComPtr d3D12ComputeCommandQueue; + + /// + /// The instance to use for copy operations. + /// + private ComPtr d3D12CopyCommandQueue; + + /// + /// The instance used for compute operations. + /// + private ComPtr d3D12ComputeFence; + + /// + /// The instance used for copy operations. + /// + private ComPtr d3D12CopyFence; + + /// + /// The instance for compute operations. + /// + private readonly ID3D12CommandAllocatorPool computeCommandAllocatorPool; + + /// + /// Gets the instance for copy operations. + /// + private readonly ID3D12CommandAllocatorPool copyCommandAllocatorPool; + + /// + /// The instance to use when allocating new buffers. + /// + private ID3D12DescriptorHandleAllocator shaderResourceViewDescriptorAllocator; + + /// + /// The next fence value for compute operations using . + /// + private ulong nextD3D12ComputeFenceValue = 1; + + /// + /// The next fence value for copy operations using . + /// + private ulong nextD3D12CopyFenceValue = 1; + + /// + /// The in use associated to the current device. + /// + private UniquePtr allocator; + + /// + /// Creates a new instance for the input . + /// + /// The to use for the new instance. + /// The that was created from. + /// The available info for the new instance. + internal GraphicsDevice(ID3D12Device* d3D12Device, IDXGIAdapter* dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + { + this.d3D12Device = new ComPtr(d3D12Device); + this.d3D12ComputeCommandQueue = d3D12Device->CreateCommandQueue(D3D12_COMMAND_LIST_TYPE_COMPUTE); + this.d3D12CopyCommandQueue = d3D12Device->CreateCommandQueue(D3D12_COMMAND_LIST_TYPE_COPY); + this.d3D12ComputeFence = d3D12Device->CreateFence(); + this.d3D12CopyFence = d3D12Device->CreateFence(); + + this.computeCommandAllocatorPool = new ID3D12CommandAllocatorPool(D3D12_COMMAND_LIST_TYPE_COMPUTE); + this.copyCommandAllocatorPool = new ID3D12CommandAllocatorPool(D3D12_COMMAND_LIST_TYPE_COPY); + this.shaderResourceViewDescriptorAllocator = new ID3D12DescriptorHandleAllocator(d3D12Device); + + Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); + Name = new string((char*)dxgiDescription1->Description); + DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory; + SharedMemorySize = dxgiDescription1->SharedSystemMemory; + IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0; + + var d3D12Options1Data = d3D12Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1); + + ComputeUnits = d3D12Options1Data.TotalLaneCount; + WavefrontSize = d3D12Options1Data.WaveLaneCountMin; + + var d3D12Architecture1Data = d3D12Device->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1); + + IsCacheCoherentUMA = d3D12Architecture1Data.CacheCoherentUMA != 0; + + D3D12MA_ALLOCATOR_DESC allocatorDesc = default; + allocatorDesc.pDevice = d3D12Device; + allocatorDesc.pAdapter = dxgiAdapter; + + if (!IsCacheCoherentUMA) + { + fixed (D3D12MA_Allocator** allocator = this.allocator) + { + D3D12MemAlloc.D3D12MA_CreateAllocator(&allocatorDesc, allocator).Assert(); + } + } + } + + /// + /// Gets the locally unique identifier for the current device. + /// + public Luid Luid { get; } + + /// + /// Gets the name of the current instance. + /// + public string Name { get; } + + /// + /// Gets the size of the dedicated memory for the current device. + /// + public nuint DedicatedMemorySize { get; } + + /// + /// Gets the size of the shared system memory for the current device. + /// + public nuint SharedMemorySize { get; } + + /// + /// Gets whether or not the current device is hardware accelerated. + /// This value is for software fallback devices. + /// + public bool IsHardwareAccelerated { get; } + + /// + /// Gets the number of total lanes on the current device (eg. CUDA cores on an nVidia GPU). + /// + public uint ComputeUnits { get; } + + /// + /// Gets the number of lanes in a SIMD wave on the current device (also known as "wavefront size" or "warp width"). + /// + public uint WavefrontSize { get; } + + /// + /// Gets the underlying wrapped by the current instance. + /// + internal ID3D12Device* D3D12Device => this.d3D12Device; + + /// + /// Gets the underlying wrapped by the current instance. + /// + internal D3D12MA_Allocator* Allocator => this.allocator; + + /// + /// Gets whether or not the current device has a cache coherent UMA architecture. + /// + internal bool IsCacheCoherentUMA { get; } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadOnlyTexture2DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE2D); + } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadWriteTexture2DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported( + DXGIFormatHelper.GetForType(), + D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW); + } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadOnlyTexture3DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE3D); + } + + /// + /// Checks whether the current device supports the creation of + /// resources for a specified type . + /// + /// The type of values to check support for. + /// Whether instances can be created by the current device. + [Pure] + public bool IsReadWriteTexture3DSupportedForType() + where T : unmanaged + { + ThrowIfDisposed(); + + return this.d3D12Device.Get()->IsDxgiFormatSupported( + DXGIFormatHelper.GetForType(), + D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW); + } + + /// + internal void RentShaderResourceViewDescriptorHandles( + out D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + out D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + this.shaderResourceViewDescriptorAllocator.Rent(out d3D12CpuDescriptorHandle, out d3D12GpuDescriptorHandle); + } + + /// + internal void ReturnShaderResourceViewDescriptorHandles( + D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandle, + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle) + { + this.shaderResourceViewDescriptorAllocator.Return(d3D12CpuDescriptorHandle, d3D12GpuDescriptorHandle); + } + + /// + /// The type of command allocator to rent. + internal ComPtr GetCommandAllocator(D3D12_COMMAND_LIST_TYPE d3D12CommandListType) + { + return d3D12CommandListType switch + { + D3D12_COMMAND_LIST_TYPE_COMPUTE => this.computeCommandAllocatorPool.GetCommandAllocator(this.d3D12Device, this.d3D12ComputeFence), + D3D12_COMMAND_LIST_TYPE_COPY => this.copyCommandAllocatorPool.GetCommandAllocator(this.d3D12Device, this.d3D12CopyFence), + _ => ThrowHelper.ThrowArgumentException>() + }; + } + + /// + /// Sets the descriptor heap for a given instance. + /// + /// The input instance to use. + internal void SetDescriptorHeapForCommandList(ID3D12GraphicsCommandList* d3D12GraphicsCommandList) + { + ID3D12DescriptorHeap* d3D12DescriptorHeap = this.shaderResourceViewDescriptorAllocator.D3D12DescriptorHeap; + + d3D12GraphicsCommandList->SetDescriptorHeaps(1, &d3D12DescriptorHeap); + } + + /// + /// Executes a given command list and waits for the operation to be completed. + /// + /// The input to execute. + internal void ExecuteCommandList(ref CommandList commandList) + { + ref readonly ID3D12CommandAllocatorPool commandAllocatorPool = ref Unsafe.NullRef(); + ID3D12CommandQueue* d3D12CommandQueue; + ID3D12Fence* d3D12Fence; + ulong d3D12FenceValue; + + // Get the target command queue, fence and pool for the list type + switch (commandList.D3D12CommandListType) + { + case D3D12_COMMAND_LIST_TYPE_COMPUTE: + commandAllocatorPool = ref this.computeCommandAllocatorPool; + d3D12CommandQueue = this.d3D12ComputeCommandQueue; + d3D12Fence = this.d3D12ComputeFence; + d3D12FenceValue = this.nextD3D12ComputeFenceValue++; + break; + case D3D12_COMMAND_LIST_TYPE_COPY: + commandAllocatorPool = ref this.copyCommandAllocatorPool; + d3D12CommandQueue = this.d3D12CopyCommandQueue; + d3D12Fence = this.d3D12CopyFence; + d3D12FenceValue = this.nextD3D12CopyFenceValue++; + break; + default: ThrowHelper.ThrowArgumentException(); return; + } + + // Execute the command list and signal to the target fence + d3D12CommandQueue->ExecuteCommandLists(1, commandList.GetD3D12CommandListAddressOf()); + + d3D12CommandQueue->Signal(d3D12Fence, d3D12FenceValue).Assert(); + + // If the fence value hasn't been reached, wait until the operation completes + if (d3D12FenceValue > d3D12Fence->GetCompletedValue()) + { + d3D12Fence->SetEventOnCompletion(d3D12FenceValue, default).Assert(); + } + + // Enqueue the command allocator pool so that it can be reused later + commandAllocatorPool.Enqueue(commandList.DetachD3D12CommandAllocator()); + } + + /// + protected override bool OnDispose() + { + if (DeviceHelper.GetDefaultDeviceLuid() == Luid) + { + return false; + } + + DeviceHelper.NotifyDisposedDevice(this); + + this.d3D12Device.Dispose(); + this.d3D12ComputeCommandQueue.Dispose(); + this.d3D12CopyCommandQueue.Dispose(); + this.d3D12ComputeFence.Dispose(); + this.d3D12CopyFence.Dispose(); + this.computeCommandAllocatorPool.Dispose(); + this.copyCommandAllocatorPool.Dispose(); + this.shaderResourceViewDescriptorAllocator.Dispose(); + this.allocator.Dispose(); + + return true; + } + + /// + public override string ToString() + { + return $"[{Luid}] {Name}"; + } + } +} diff --git a/src/ComputeSharp/Graphics/GraphicsDeviceInfo.cs b/src/ComputeSharp/Graphics/GraphicsDeviceInfo.cs new file mode 100644 index 00000000..5c4b7f48 --- /dev/null +++ b/src/ComputeSharp/Graphics/GraphicsDeviceInfo.cs @@ -0,0 +1,50 @@ +using TerraFX.Interop; +using static TerraFX.Interop.DXGI_ADAPTER_FLAG; + +namespace ComputeSharp +{ + /// + /// A type containing info on a given DX12.0 device that can be used. + /// + public readonly struct GraphicsDeviceInfo + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The available info for the associated device. + internal unsafe GraphicsDeviceInfo(DXGI_ADAPTER_DESC1* dxgiDescription1) + { + Luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); + Name = new string((char*)dxgiDescription1->Description); + DedicatedMemorySize = dxgiDescription1->DedicatedVideoMemory; + SharedMemorySize = dxgiDescription1->SharedSystemMemory; + IsHardwareAccelerated = (dxgiDescription1->Flags & (uint)DXGI_ADAPTER_FLAG_SOFTWARE) == 0; + } + + /// + /// Gets the locally unique identifier for the current device. + /// + public Luid Luid { get; } + + /// + /// Gets the name of the associated device. + /// + public string Name { get; } + + /// + /// Gets the size of the dedicated memory for the associated device. + /// + public nuint DedicatedMemorySize { get; } + + /// + /// Gets the size of the shared system memory for the associated device. + /// + public nuint SharedMemorySize { get; } + + /// + /// Gets whether or not the associated device is hardware accelerated. + /// This value is for software fallback devices. + /// + public bool IsHardwareAccelerated { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Helpers/D3D12FeatureHelper.cs b/src/ComputeSharp/Graphics/Helpers/D3D12FeatureHelper.cs new file mode 100644 index 00000000..8c3e003b --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/D3D12FeatureHelper.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_FEATURE; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp.Graphics.Helpers +{ + /// + /// A helper exposing some runtime or OS dependent D3D12 features. + /// + internal static class D3D12FeatureHelper + { + /// + /// The currently supported flag (or fallback). + /// + private static readonly D3D12_HEAP_FLAGS D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = GetD3D12_HEAP_FLAG_CREATE_NOT_ZEROED(); + + /// + /// Gets the value for a given setting. + /// + /// The allocation mode to use for creating new resources. + /// The matching that is currently supported + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static D3D12_HEAP_FLAGS GetD3D12HeapFlags(AllocationMode allocationMode) + { + if (allocationMode == AllocationMode.Default) + { + return D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + } + + return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_NONE; + } + + /// + /// Initializes the field. + /// + /// The currently supported flag. + private static unsafe D3D12_HEAP_FLAGS GetD3D12_HEAP_FLAG_CREATE_NOT_ZEROED() + { + lock (DeviceHelper.DevicesCache) + { + foreach (KeyValuePair pair in DeviceHelper.DevicesCache) + { + D3D12_FEATURE_DATA_D3D12_OPTIONS7 d3D12Options7; + + int result = pair.Value.D3D12Device->CheckFeatureSupport( + D3D12_FEATURE_D3D12_OPTIONS7, + &d3D12Options7, + (uint)sizeof(D3D12_FEATURE_DATA_D3D12_OPTIONS7)); + + if (result == FX.S_OK) + { + return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + } + + break; + } + + return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_NONE; + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs b/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs new file mode 100644 index 00000000..c12698ae --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/DXGIFormatHelper.cs @@ -0,0 +1,51 @@ +using System.Diagnostics.Contracts; +using System.Numerics; +using System.Runtime.CompilerServices; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.DXGI_FORMAT; + +namespace ComputeSharp.Graphics.Helpers +{ + /// + /// A helper type with utility methods for . + /// + internal static class DXGIFormatHelper + { + /// + /// Gets the appropriate value for the input type argument. + /// + /// The input type argument to get the corresponding for. + /// The value corresponding to . + /// Thrown when the input type is not supported. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static DXGI_FORMAT GetForType() + where T : unmanaged + { + if (typeof(T) == typeof(int)) return DXGI_FORMAT_R32_SINT; + else if (typeof(T) == typeof(Int2)) return DXGI_FORMAT_R32G32_SINT; + else if (typeof(T) == typeof(Int3)) return DXGI_FORMAT_R32G32B32_SINT; + else if (typeof(T) == typeof(Int4)) return DXGI_FORMAT_R32G32B32A32_SINT; + else if (typeof(T) == typeof(uint)) return DXGI_FORMAT_R32_UINT; + else if (typeof(T) == typeof(UInt2)) return DXGI_FORMAT_R32G32_UINT; + else if (typeof(T) == typeof(UInt3)) return DXGI_FORMAT_R32G32B32_UINT; + else if (typeof(T) == typeof(UInt4)) return DXGI_FORMAT_R32G32B32A32_UINT; + else if (typeof(T) == typeof(float)) return DXGI_FORMAT_R32_FLOAT; + else if (typeof(T) == typeof(Float2)) return DXGI_FORMAT_R32G32_FLOAT; + else if (typeof(T) == typeof(Float3)) return DXGI_FORMAT_R32G32B32_FLOAT; + else if (typeof(T) == typeof(Float4)) return DXGI_FORMAT_R32G32B32A32_FLOAT; + else if (typeof(T) == typeof(Vector2)) return DXGI_FORMAT_R32G32_FLOAT; + else if (typeof(T) == typeof(Vector3)) return DXGI_FORMAT_R32G32B32_FLOAT; + else if (typeof(T) == typeof(Vector4)) return DXGI_FORMAT_R32G32B32A32_FLOAT; + else if (typeof(T) == typeof(Bgra32)) return DXGI_FORMAT_B8G8R8A8_UNORM; + else if (typeof(T) == typeof(Rgba32)) return DXGI_FORMAT_R8G8B8A8_UNORM; + else if (typeof(T) == typeof(Rgba64)) return DXGI_FORMAT_R16G16B16A16_UNORM; + else if (typeof(T) == typeof(R8)) return DXGI_FORMAT_R8_UNORM; + else if (typeof(T) == typeof(R16)) return DXGI_FORMAT_R16_UNORM; + else if (typeof(T) == typeof(Rg16)) return DXGI_FORMAT_R8G8_UNORM; + else if (typeof(T) == typeof(Rg32)) return DXGI_FORMAT_R16G16_UNORM; + else return ThrowHelper.ThrowArgumentException("Invalid texture type"); + } + } +} diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Enumerator.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Enumerator.cs new file mode 100644 index 00000000..72ab52b1 --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Enumerator.cs @@ -0,0 +1,209 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Interop; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; +using HRESULT = System.Int32; + +namespace ComputeSharp.Graphics.Helpers +{ + /// + internal static partial class DeviceHelper + { + /// + /// A custom query type that iterates through devices matching a given predicate. + /// + public sealed unsafe class DeviceQuery : IEnumerable + { + /// + /// The instance to use to select devices to create. + /// + private readonly Predicate predicate; + + /// + /// Creates a new instance for the given predicate. + /// + /// The input predicate to select devices to create. + public DeviceQuery(Predicate predicate) + { + this.predicate = predicate; + } + + /// + public IEnumerator GetEnumerator() + { + return new Enumerator(this.predicate); + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return new Enumerator(this.predicate); + } + + /// + /// The enumerator type for a instance. + /// + private sealed unsafe class Enumerator : NativeObject, IEnumerator + { + /// + /// The instance to use to select devices to create. + /// + private readonly Predicate predicate; + + /// + /// The instance used to enumerate devices. + /// + private ComPtr dxgiFactory4; + + /// + /// Indicates whether or not the enumerator has already been initialized and is set. + /// + private bool isInitialized; + + /// + /// The current adapter index to enumerate adapters from . + /// + private uint index; + + /// + /// Indicates whether or not the enumerator has completed the enumeration of all possible devices. + /// + private bool isCompleted; + + /// + /// The current instance to return. + /// + private GraphicsDevice? graphicsDevice; + + /// + /// Creates a new instance for the given predicate. + /// + /// The input predicate to select devices to create. + public Enumerator(Predicate predicate) + { + this.predicate = predicate; + } + + /// + public GraphicsDevice Current => this.graphicsDevice!; + + /// + object IEnumerator.Current => this.graphicsDevice!; + + /// + public bool MoveNext() + { + if (!this.isInitialized) + { + this.isInitialized = true; + + fixed (IDXGIFactory4** dxgiFactory4 = this.dxgiFactory4) + { + EnableDebugMode(); + + FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, FX.__uuidof(), (void**)dxgiFactory4).Assert(); + } + } + + if (this.isCompleted) return false; + + while (true) + { + using ComPtr dxgiAdapter1 = default; + + HRESULT enumAdapters1Result = this.dxgiFactory4.Get()->EnumAdapters1(this.index, dxgiAdapter1.GetAddressOf()); + + if (enumAdapters1Result == FX.DXGI_ERROR_NOT_FOUND) + { + this.dxgiFactory4.Get()->EnumWarpAdapter(FX.__uuidof(), dxgiAdapter1.GetVoidAddressOf()).Assert(); + + DXGI_ADAPTER_DESC1 dxgiDescription1; + + dxgiAdapter1.Get()->GetDesc1(&dxgiDescription1).Assert(); + + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + null); + + if (FX.SUCCEEDED(createDeviceResult) && + this.predicate(new GraphicsDeviceInfo(&dxgiDescription1))) + { + using ComPtr d3D12Device = default; + + FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + d3D12Device.GetVoidAddressOf()).Assert(); + + this.graphicsDevice = GetOrCreateDevice(d3D12Device.Get(), (IDXGIAdapter*)dxgiAdapter1.Get(), &dxgiDescription1); + this.isCompleted = true; + + return true; + } + + return false; + } + else + { + enumAdapters1Result.Assert(); + + this.index++; + + DXGI_ADAPTER_DESC1 dxgiDescription1; + + dxgiAdapter1.Get()->GetDesc1(&dxgiDescription1).Assert(); + + if (dxgiDescription1.VendorId == MicrosoftVendorId && + dxgiDescription1.DeviceId == WarpDeviceId) + { + continue; + } + + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + null); + + if (FX.SUCCEEDED(createDeviceResult) && + this.predicate(new GraphicsDeviceInfo(&dxgiDescription1))) + { + using ComPtr d3D12Device = default; + + FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + d3D12Device.GetVoidAddressOf()).Assert(); + + this.graphicsDevice = GetOrCreateDevice(d3D12Device.Get(), (IDXGIAdapter*)dxgiAdapter1.Get(), &dxgiDescription1); + + return true; + } + } + } + } + + /// + public void Reset() + { + throw new NotImplementedException(); + } + + /// + protected override bool OnDispose() + { + this.dxgiFactory4.Dispose(); + + return true; + } + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Factory.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Factory.cs new file mode 100644 index 00000000..cf5d55f9 --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.Factory.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; +#if DEBUG +using ComputeSharp.Graphics.Extensions; +#endif +using TerraFX.Interop; + +namespace ComputeSharp.Graphics.Helpers +{ + /// + internal static partial class DeviceHelper + { + /// + /// The local cache of instances that are currently usable. + /// + internal static readonly Dictionary DevicesCache = new(); + +#if DEBUG + /// + /// The local map of instances for the existing devices. + /// + private static readonly Dictionary> D3D12InfoQueueMap = new(); +#endif + + /// + /// Retrieves a instance for an object. + /// + /// The to use to get a instance. + /// The that was created from. + /// The available info for the instance. + /// A instance for the input device. + private static unsafe GraphicsDevice GetOrCreateDevice(ID3D12Device* d3D12Device, IDXGIAdapter* dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + { + lock (DevicesCache) + { + Luid luid = Luid.FromLUID(dxgiDescription1->AdapterLuid); + + if (!DevicesCache.TryGetValue(luid, out GraphicsDevice? device)) + { + device = new GraphicsDevice(d3D12Device, dxgiAdapter, dxgiDescription1); + + DevicesCache.Add(luid, device); + +#if DEBUG + D3D12InfoQueueMap.Add(luid, d3D12Device->CreateInfoQueue()); +#endif + } + + return device; + } + } + + /// + /// Removes a from the internal cache. + /// + /// The instance to remove from the internal cache. + public static void NotifyDisposedDevice(GraphicsDevice device) + { + lock (DevicesCache) + { + DevicesCache.Remove(device.Luid); + +#if DEBUG + D3D12InfoQueueMap.Remove(device.Luid, out ComPtr queue); + + queue.Dispose(); +#endif + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs new file mode 100644 index 00000000..ad37f005 --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.ID3D12InfoQueue.cs @@ -0,0 +1,82 @@ +#if DEBUG + +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Text; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_MESSAGE_SEVERITY; + +namespace ComputeSharp.Graphics.Helpers +{ + /// + internal static partial class DeviceHelper + { + /// + /// Flushes all the pending debug messages for all existing instances to the console/debugger. + /// It also checks whether or not there are any error messages being logged that didn't result in an actual crash yet. + /// + /// Whether or not there are any logged errors or warnings. + public static unsafe bool FlushAllID3D12InfoQueueMessagesAndCheckForErrorsOrWarnings() + { + bool hasErrorsOrWarnings = false; + + lock (DevicesCache) + { + int j = 0; + StringBuilder builder = new(1024); + + foreach (var pair in D3D12InfoQueueMap) + { + var device = DevicesCache[pair.Key]; + var queue = pair.Value; + + ulong messages = queue.Get()->GetNumStoredMessagesAllowedByRetrievalFilter(); + + for (ulong i = 0; i < messages; i++) + { + nuint length; + queue.Get()->GetMessage(i, null, &length); + + D3D12_MESSAGE* message = (D3D12_MESSAGE*)Marshal.AllocHGlobal((nint)length); + + queue.Get()->GetMessage(i, message, &length); + + builder.Clear(); + builder.AppendLine($"[D3D12 message #{i} for \"{device}\" (HW: {device.IsHardwareAccelerated}, UMA: {device.IsCacheCoherentUMA})]"); + builder.AppendLine($"[Category]: {Enum.GetName(message->Category)}"); + builder.AppendLine($"[Severity]: {Enum.GetName(message->Severity)}"); + builder.AppendLine($"[ID]: {Enum.GetName(message->ID)}"); + builder.Append($"[Description]: \"{new string(message->pDescription)}\""); + + Marshal.FreeHGlobal((IntPtr)message); + + if (message->Severity is D3D12_MESSAGE_SEVERITY_ERROR or D3D12_MESSAGE_SEVERITY_CORRUPTION or D3D12_MESSAGE_SEVERITY_WARNING) + { + hasErrorsOrWarnings = true; + } + + string text = builder.ToString(); + + if (Debugger.IsAttached) + { + Debug.WriteLine(text); + } + else + { + Console.WriteLine(text); + } + } + + queue.Get()->ClearStoredMessages(); + + j++; + } + } + + return hasErrorsOrWarnings; + } + } +} + +#endif diff --git a/src/ComputeSharp/Graphics/Helpers/DeviceHelper.cs b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.cs new file mode 100644 index 00000000..def2b0c0 --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/DeviceHelper.cs @@ -0,0 +1,190 @@ +using System; +using System.Diagnostics; +using System.Diagnostics.Contracts; +using ComputeSharp.Core.Extensions; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; +using HRESULT = System.Int32; + +namespace ComputeSharp.Graphics.Helpers +{ + /// + /// A with methods to inspect the available devices on the current machine. + /// + internal static partial class DeviceHelper + { + /// + /// The vendor id for Microsoft adapters (the "Microsoft Basic Render"). + /// + private const uint MicrosoftVendorId = 0x1414; + + /// + /// The device id for the WARP device. + /// + private const uint WarpDeviceId = 0x8C; + + /// + /// Gets whether or not there is a default device available, without creating it. + /// + /// Whether or not there is a device supporting at least DX12.0. + [Pure] + public static unsafe bool IsDefaultDeviceAvailable() + { + DXGI_ADAPTER_DESC1 dxgiDescription1; + + return TryGetDefaultDevice(null, null, &dxgiDescription1) || TryGetWarpDevice(null, null, &dxgiDescription1); + } + + /// + /// Gets the of the default device. + /// + /// The of the default device supporting at least DX12.0. + /// This methods assumes that a default device is available. + [Pure] + public static unsafe Luid GetDefaultDeviceLuid() + { + DXGI_ADAPTER_DESC1 dxgiDescription1; + + _ = TryGetDefaultDevice(null, null, &dxgiDescription1) || TryGetWarpDevice(null, null, &dxgiDescription1); + + return Luid.FromLUID(dxgiDescription1.AdapterLuid); + } + + /// + /// Gets the default instance. + /// + /// The default instance supporting at least DX12.0. + /// Thrown when a default device is not available. + public static unsafe GraphicsDevice GetDefaultDevice() + { + using ComPtr d3D12Device = default; + using ComPtr dxgiAdapter = default; + + DXGI_ADAPTER_DESC1 dxgiDescription1; + + if (TryGetDefaultDevice(d3D12Device.GetAddressOf(), dxgiAdapter.GetAddressOf(), &dxgiDescription1) || + TryGetWarpDevice(d3D12Device.GetAddressOf(), dxgiAdapter.GetAddressOf(), &dxgiDescription1)) + { + return GetOrCreateDevice(d3D12Device.Get(), dxgiAdapter.Get(), &dxgiDescription1); + } + + return ThrowHelper.ThrowNotSupportedException("There isn't a supported GPU device on the current machine"); + } + + /// + /// Tries to check or create a default object. + /// + /// A pointer to the object to create, or . + /// A pointer to the object used to create , or . + /// A pointer to the value for the device found. + /// Whether a default device was found with the requested feature level. + private static unsafe bool TryGetDefaultDevice(ID3D12Device** d3D12Device, IDXGIAdapter** dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + { + using ComPtr dxgiFactory4 = default; + + EnableDebugMode(); + + FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, FX.__uuidof(), dxgiFactory4.GetVoidAddressOf()).Assert(); + + uint i = 0; + + while (true) + { + using ComPtr dxgiAdapter1 = default; + + HRESULT enumAdapters1Result = dxgiFactory4.Get()->EnumAdapters1(i++, dxgiAdapter1.GetAddressOf()); + + if (enumAdapters1Result == FX.DXGI_ERROR_NOT_FOUND) + { + return false; + } + + enumAdapters1Result.Assert(); + + dxgiAdapter1.Get()->GetDesc1(dxgiDescription1).Assert(); + + if (dxgiDescription1->VendorId == MicrosoftVendorId && + dxgiDescription1->DeviceId == WarpDeviceId) + { + continue; + } + + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + (void**)d3D12Device); + + if (FX.SUCCEEDED(createDeviceResult)) + { + dxgiAdapter1.CopyTo(dxgiAdapter); + + return true; + } + } + } + + /// + /// Tries to check or create a warp object. + /// + /// A pointer to the object to create, or . + /// A pointer to the object used to create , or . + /// A pointer to the value for the device found. + /// Whether a warp device was created successfully. + private static unsafe bool TryGetWarpDevice(ID3D12Device** d3D12Device, IDXGIAdapter** dxgiAdapter, DXGI_ADAPTER_DESC1* dxgiDescription1) + { + using ComPtr dxgiFactory4 = default; + + EnableDebugMode(); + + FX.CreateDXGIFactory2(IDXGIFactoryCreationFlags, FX.__uuidof(), dxgiFactory4.GetVoidAddressOf()).Assert(); + + using ComPtr dxgiAdapter1 = default; + + dxgiFactory4.Get()->EnumWarpAdapter(FX.__uuidof(), dxgiAdapter1.GetVoidAddressOf()).Assert(); + + dxgiAdapter1.Get()->GetDesc1(dxgiDescription1).Assert(); + + HRESULT createDeviceResult = FX.D3D12CreateDevice( + dxgiAdapter1.AsIUnknown().Get(), + D3D_FEATURE_LEVEL.D3D_FEATURE_LEVEL_11_0, + FX.__uuidof(), + (void**)d3D12Device); + + dxgiAdapter1.CopyTo(dxgiAdapter); + + return FX.SUCCEEDED(createDeviceResult); + } + + /// + /// The creation flags for instances. + /// + private const uint IDXGIFactoryCreationFlags = +#if DEBUG + FX.DXGI_CREATE_FACTORY_DEBUG; +#else + 0; +#endif + + /// + /// Enables the debug layer for DirectX APIs. + /// + [Conditional("DEBUG")] + private static unsafe void EnableDebugMode() + { + using ComPtr d3D12Debug = default; + using ComPtr d3D12Debug1 = default; + + FX.D3D12GetDebugInterface(FX.__uuidof(), d3D12Debug.GetVoidAddressOf()).Assert(); + + d3D12Debug.Get()->EnableDebugLayer(); + + if (FX.SUCCEEDED(d3D12Debug.CopyTo(d3D12Debug1.GetAddressOf()))) + { + d3D12Debug1.Get()->SetEnableGPUBasedValidation(FX.TRUE); + d3D12Debug1.Get()->SetEnableSynchronizedCommandQueueValidation(FX.TRUE); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Helpers/MemoryHelper.cs b/src/ComputeSharp/Graphics/Helpers/MemoryHelper.cs new file mode 100644 index 00000000..c3f56001 --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/MemoryHelper.cs @@ -0,0 +1,250 @@ +using System; +using System.Runtime.CompilerServices; + +namespace ComputeSharp.Graphics.Helpers +{ + /// + /// A with some helper methods to copy data between memory areas. + /// + internal static class MemoryHelper + { + /// + /// Copies the content of a source memory area to a target one, accounting for padding. + /// The destination memory area has padding for each element, while the source does not. + /// + /// The source memory area to read from. + /// The pointer for the destination memory area. + /// The destination offset to start writing data to. + /// The number of items to copy. + /// The padded size of each element. + /// Indicates whether or not the source is padded too. + public static unsafe void Copy( + void* source, + void* destination, + uint offset, + uint length, + uint elementPitchInBytes, + bool isPaddingInSourceToo) + where T : unmanaged + { + destination = (byte*)destination + offset * elementPitchInBytes; + + if (isPaddingInSourceToo) + { + for (int i = 0; i < length; i++) + { + *(T*)&((byte*)destination)[i * elementPitchInBytes] = *(T*)&((byte*)source)[i * elementPitchInBytes]; + } + } + else + { + for (int i = 0; i < length; i++) + { + *(T*)&((byte*)destination)[i * elementPitchInBytes] = ((T*)source)[i]; + } + } + } + + /// + /// Copies the content of a source memory area to a target one. + /// + /// The source memory area to read from. + /// The source offset to start reading data from. + /// The number of items to copy. + /// The size in bytes of each item to copy. + /// The pointer for the destination memory area. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void Copy( + void* source, + uint offset, + uint length, + uint elementSizeInBytes, + void* destination) + { + Buffer.MemoryCopy( + (byte*)source + offset * elementSizeInBytes, + destination, + ulong.MaxValue, + elementSizeInBytes * length); + } + + /// + /// Copies the content of a source memory area to a target one, accounting for padding. + /// The source memory area has padding for each element, while the destination does not. + /// + /// The source memory area to read from. + /// The source offset to start reading data from. + /// The number of items to copy. + /// The padded size of each element. + /// The pointer for the destination memory area. + public static unsafe void Copy( + void* source, + uint offset, + uint length, + uint elementPitchInBytes, + void* destination) + where T : unmanaged + { + source = (byte*)source + offset * elementPitchInBytes; + + for (int i = 0; i < length; i++) + { + ((T*)destination)[i] = *(T*)&((byte*)source)[i * elementPitchInBytes]; + } + } + + /// + /// Copies the content of a source memory area to the 2D area pointed by an input pointer. + /// The destination memory area has padding in each row, while the source does not. + /// + /// The source pointer to read from. + /// The pointer that indicates the 2D memory area to write to. + /// The height of the 2D memory area to write to. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + public static unsafe void Copy( + void* source, + void* destination, + uint height, + ulong widthInBytes, + ulong pitchInBytes) + { + if (widthInBytes == pitchInBytes) + { + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height); + } + else + { + for (int i = 0; i < height; i++) + { + Buffer.MemoryCopy( + (byte*)source + (uint)i * widthInBytes, + (byte*)destination + (uint)i * pitchInBytes, + ulong.MaxValue, + widthInBytes); + } + } + } + + /// + /// Copies a 2D memory area pointed by a pointer value to a target memory area. + /// The source memory area has padding in each row, while the target does not. + /// + /// The pointer that indicates the memory area to read from. + /// The height of the 2D memory area to read. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + /// The destination pointer to write to. + public static unsafe void Copy( + void* source, + uint height, + ulong widthInBytes, + ulong pitchInBytes, + void* destination) + { + if (widthInBytes == pitchInBytes) + { + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height); + } + else + { + for (int i = 0; i < height; i++) + { + Buffer.MemoryCopy( + (byte*)source + (uint)i * pitchInBytes, + (byte*)destination + (uint)i * widthInBytes, + ulong.MaxValue, + widthInBytes); + } + } + } + + /// + /// Copies the content of a source memory area to the 3D area pointed by an input pointer. + /// The destination memory area has padding in each row, while the source does not. + /// + /// The source memory area to read from. + /// The pointer that indicates the 3D memory area to write to. + /// The height of the 3D memory area to write to. + /// The depth of the 3D memory area to write to. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + /// The size in bytes of each 2D slice within the target 3D memory area. + public static unsafe void Copy( + void* source, + void* destination, + uint height, + uint depth, + ulong widthInBytes, + ulong pitchInBytes, + ulong sliceInBytes) + { + if (widthInBytes == pitchInBytes) + { + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height * depth); + } + else + { + for (int z = 0; z < depth; z++) + { + ulong + sourceZOffset = (uint)z * widthInBytes * height, + destinationZOffset = (uint)z * sliceInBytes; + + for (int i = 0; i < height; i++) + { + Buffer.MemoryCopy( + (byte*)source + sourceZOffset + (uint)i * widthInBytes, + (byte*)destination + destinationZOffset + (uint)i * pitchInBytes, + ulong.MaxValue, + widthInBytes); + } + } + } + } + + /// + /// Copies a 3D memory area pointed by a pointer value to a target memory area. + /// The source memory area has padding in each row, while the target does not. + /// + /// The pointer that indicates the memory area to read from. + /// The height of the 3D memory area to read. + /// The depth of the 3D memory area to read. + /// The width of the memory area in bytes. + /// The pitch (padded width) of the memory area in bytes. + /// The size in bytes of each 2D slice within the source 3D memory area. + /// The destination pointer to write. + public static unsafe void Copy( + void* source, + uint height, + uint depth, + ulong widthInBytes, + ulong pitchInBytes, + ulong sliceInBytes, + void* destination) + { + if (widthInBytes == pitchInBytes) + { + Buffer.MemoryCopy(source, destination, ulong.MaxValue, widthInBytes * height * depth); + } + else + { + for (int z = 0; z < depth; z++) + { + ulong + sourceZOffset = (uint)z * sliceInBytes, + destinationZOffset = (uint)z * widthInBytes * height; + + for (int i = 0; i < height; i++) + { + Buffer.MemoryCopy( + (byte*)source + sourceZOffset + (uint)i * pitchInBytes, + (byte*)destination + destinationZOffset + (uint)i * widthInBytes, + ulong.MaxValue, + widthInBytes); + } + } + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs new file mode 100644 index 00000000..fdf9a066 --- /dev/null +++ b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs @@ -0,0 +1,217 @@ +using System; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using ComputeSharp.Resources; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; + +namespace ComputeSharp.__Internals +{ + /// + /// A helper class with some proxy methods to expose to generated code in external projects. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This type is not intended to be used directly by user code")] + public static class GraphicsResourceHelper + { + /// + /// An interface for non-generic graphics resource types. + /// + internal interface IGraphicsResource + { + /// + /// Validates the given resource for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The target instance in use. + /// The GPU descriptor handle for the resource. + D3D12_GPU_DESCRIPTOR_HANDLE ValidateAndGetGpuDescriptorHandle(GraphicsDevice device); + } + + /// + /// Validates the given buffer for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input buffer. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the buffer. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(Buffer buffer, GraphicsDevice device) + where T : unmanaged + { + buffer.ThrowIfDisposed(); + buffer.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in buffer.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture2D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture2D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture2D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) + { + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + + return *(ulong*)&d3D12GpuDescriptorHandle; + } + + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture2D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) + { + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + + return *(ulong*)&d3D12GpuDescriptorHandle; + } + + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture3D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture3D texture, GraphicsDevice device) + where T : unmanaged + { + texture.ThrowIfDisposed(); + texture.ThrowIfDeviceMismatch(device); + + return Unsafe.As(ref Unsafe.AsRef(in texture.D3D12GpuDescriptorHandle)); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture3D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) + { + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + + return *(ulong*)&d3D12GpuDescriptorHandle; + } + + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + } + + /// + /// Validates the given texture for usage with a specified device, and retrieves its GPU descriptor handle. + /// + /// The type of normalized values stored in the input texture. + /// The input instance to check. + /// The target instance in use. + /// The GPU descriptor handle for the texture. + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("This method is not intended to be called directly by user code")] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture3D texture, GraphicsDevice device) + where TPixel : unmanaged + { + if (texture is IGraphicsResource resource) + { + D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle = resource.ValidateAndGetGpuDescriptorHandle(device); + + return *(ulong*)&d3D12GpuDescriptorHandle; + } + + return ThrowHelper.ThrowArgumentException("The input texture is not a valid instance"); + } + } +} diff --git a/src/ComputeSharp/Graphics/Interop/InteropServices.cs b/src/ComputeSharp/Graphics/Interop/InteropServices.cs new file mode 100644 index 00000000..a15d9f84 --- /dev/null +++ b/src/ComputeSharp/Graphics/Interop/InteropServices.cs @@ -0,0 +1,148 @@ +using System; +using ComputeSharp.Resources; + +namespace ComputeSharp.Interop +{ + /// + /// Provides methods to interoperate with the native APIs and the managed types in this library. + /// + /// None of the APIs in perform input validation, and it is responsibility + /// of consumers to ensure the input arguments are in a correct state to be used (eg. not disposed). + /// + /// + /// Manually interfering with the underlying COM objects for any of these types can result in issues if + /// the operations are not done correctly, which can prevent other APIs from functioning as expected. + /// Consumers should ensure the executed operations do not result in any errors. Furthermore, even when + /// the reference count to the returned COM object is incremented, consumers should ensure that the owning + /// objects will remain alive as long as the returned pointers are in use, to avoid unexpected issues. This + /// is because the lifecycle of certain COM objects (eg. resources) is delegated to an internal allocator + /// that relies on resources being disposed as soon as the relative allocation object is disposed. + /// + /// + public static unsafe class InteropServices + { + /// + /// Tries to get the underlying COM object for a given device, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The input instance in use. + /// A reference to the interface identifier (IID) of the device interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Device(GraphicsDevice device, Guid* riid, void** ppvObject) + { + return device.D3D12Device->QueryInterface(riid, ppvObject); + } + + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the buffer. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(Buffer buffer, Guid* riid, void** ppvObject) + where T : unmanaged + { + return buffer.D3D12Resource->QueryInterface(riid, ppvObject); + } + + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(Texture2D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); + } + + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(Texture3D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); + } + + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the buffer. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(TransferBuffer buffer, Guid* riid, void** ppvObject) + where T : unmanaged + { + return buffer.D3D12Resource->QueryInterface(riid, ppvObject); + } + + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(TransferTexture2D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); + } + + /// + /// Tries to get the underlying COM object for a given resource, as a specified interface. This method invokes + /// IUnknown::QueryInterface. + /// + /// The type of items stored on the texture. + /// The input instance in use. + /// A reference to the interface identifier (IID) of the resource interface being queried for. + /// The address of a pointer to an interface with the IID specified in . + /// + /// S_OK if the interface is supported, and E_NOINTERFACE otherwise. + /// If ppvObject (the address) is nullptr, then this method returns E_POINTER. + /// + public static int TryGetID3D12Resource(TransferTexture3D texture, Guid* riid, void** ppvObject) + where T : unmanaged + { + return texture.D3D12Resource->QueryInterface(riid, ppvObject); + } + } +} diff --git a/src/ComputeSharp/Graphics/Interop/NativeObject.cs b/src/ComputeSharp/Graphics/Interop/NativeObject.cs new file mode 100644 index 00000000..10bdb1cd --- /dev/null +++ b/src/ComputeSharp/Graphics/Interop/NativeObject.cs @@ -0,0 +1,74 @@ +using System; +using System.Runtime.CompilerServices; + +namespace ComputeSharp.Interop +{ + /// + /// Base class for a class. + /// + public abstract class NativeObject : IDisposable + { + /// + /// Releases unmanaged resources and performs other cleanup operations. + /// + ~NativeObject() + { + _ = CheckAndDispose(); + } + + /// + /// Gets whether or not the current instance has already been disposed. + /// + internal bool IsDisposed { get; private set; } + + /// + /// Releases all the native resources for the current instance. + /// + public void Dispose() + { + if (CheckAndDispose()) + { + GC.SuppressFinalize(this); + } + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + private bool CheckAndDispose() + { + if (!IsDisposed) + { + return IsDisposed = OnDispose(); + } + + return true; + } + + /// + /// Releases unmanaged and (optionally) managed resources. + /// + /// + /// Whether or not the dispose has actually been executed. This is done in order to allow derived types to + /// optionally cancel a dispose operation, by not releasing resources and returning . + /// + protected abstract bool OnDispose(); + + /// + /// Throws an if the current instance has been disposed. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDisposed() + { + if (IsDisposed) + { + // We can't use ThrowHelper here as we only want to invoke ToString if we + // are about to throw an exception. The JIT will recognize this pattern + // as this method has a single basic block that always throws an exception. + void Throw() => throw new ObjectDisposedException(ToString()); + + Throw(); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Interop/UniquePtr{T}.cs b/src/ComputeSharp/Graphics/Interop/UniquePtr{T}.cs new file mode 100644 index 00000000..2cec96e1 --- /dev/null +++ b/src/ComputeSharp/Graphics/Interop/UniquePtr{T}.cs @@ -0,0 +1,113 @@ +using System; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using TerraFX.Interop; + +namespace ComputeSharp.Interop +{ + /// + /// A -equivalent type to safely work with pointers to public APIs. + /// + /// Must be either , , or . + /// + /// This type is not marked as so that it can also be used in fields, so make sure to + /// avoid copying it and disposing it multiple times, as that would lead to a access violation exceptions. + /// + internal unsafe struct UniquePtr : IDisposable + where T : unmanaged + { + /// + /// The raw pointer to an object, if existing. + /// + private T* pointer; + + /// + /// Creates a new instance from a raw pointer. + /// + /// The raw pointer to wrap. + public UniquePtr(T* other) + { + pointer = other; + } + + /// + /// Unwraps a instance and returns the internal raw pointer. + /// + /// The instance to unwrap. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator T*(UniquePtr other) + { + return other.Get(); + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Dispose() + { + T* pointer = this.pointer; + + if (pointer != null) + { + this.pointer = null; + + if (typeof(T) == typeof(D3D12MA_Allocator)) ((D3D12MA_Allocator*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_Allocation)) ((D3D12MA_Allocation*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_Pool)) ((D3D12MA_Pool*)pointer)->Release(); + else if (typeof(T) == typeof(D3D12MA_VirtualBlock)) ((D3D12MA_VirtualBlock*)pointer)->Release(); + else throw new ArgumentException("Invalid pointer type"); + } + } + + /// + /// Gets the currently wrapped raw pointer to an object. + /// + /// The raw pointer wrapped by the current instance. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly T* Get() + { + return this.pointer; + } + + /// + /// Gets the address of the current instance as a raw double pointer. + /// + /// The raw pointer to the current instance. + /// This method is only valid when the current instance is on the stack or pinned. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public readonly T** GetAddressOf() + { + return (T**)Unsafe.AsPointer(ref Unsafe.AsRef(in this)); + } + + /// + /// Gets the address of the current instance as a managed reference to pointer. + /// + /// The reference to the current instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + [EditorBrowsable(EditorBrowsableState.Never)] + public readonly ref T* GetPinnableReference() + { + fixed (T** ptr = &this.pointer) + { + return ref *ptr; + } + } + + /// + /// Moves the current instance and resets it without releasing the reference. + /// + /// The moved instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public UniquePtr Move() + { + UniquePtr copy = this; + + this = default; + + return copy; + } + } +} diff --git a/src/ComputeSharp/Graphics/Luid.cs b/src/ComputeSharp/Graphics/Luid.cs new file mode 100644 index 00000000..f28d1089 --- /dev/null +++ b/src/ComputeSharp/Graphics/Luid.cs @@ -0,0 +1,88 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using TerraFX.Interop; + +namespace ComputeSharp +{ + /// + /// A locally unique identifier for a graphics device. + /// + public readonly struct Luid : IEquatable + { + #pragma warning disable CS0649 + + private readonly uint lowPart; + private readonly int highPart; + + #pragma warning restore + + /// + /// Creates a new instance from a raw value. + /// + /// The input value. + /// A instance with the same value. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static unsafe Luid FromLUID(LUID luid) + { + return *(Luid*)&luid; + } + + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(Luid other) + { + return + this.lowPart == other.lowPart && + this.highPart == other.highPart; + } + + /// + [Pure] + public override bool Equals(object? other) + { + return other is Luid luid && Equals(luid); + } + + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override int GetHashCode() + { + return HashCode.Combine(this.lowPart, this.highPart); + } + + /// + [Pure] + public override string ToString() + { + return (((long)this.highPart) << 32 | this.lowPart).ToString(); + } + + /// + /// Check whether two values are equal. + /// + /// The first value to compare. + /// The second value to compare. + /// Whether and are the same. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Luid a, Luid b) + { + return a.Equals(b); + } + + /// + /// Check whether two values are different. + /// + /// The first value to compare. + /// The second value to compare. + /// Whether and are different. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Luid a, Luid b) + { + return !a.Equals(b); + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs new file mode 100644 index 00000000..f1cca2ad --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Abstract/Buffer{T}.cs @@ -0,0 +1,195 @@ +using System.Buffers; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +namespace ComputeSharp.Resources +{ + /// + /// A representing a typed buffer stored on GPU memory. + /// + /// The type of items stored on the buffer. + public unsafe abstract class Buffer : NativeObject + where T : unmanaged + { + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The instance for the current resource. + /// + private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; + + /// + /// The instance for the current resource. + /// + internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; + + /// + /// The size in bytes of the current buffer (this value is never negative). + /// + protected readonly nint SizeInBytes; + + /// + /// The instance used to retrieve , if any. + /// + /// This will be if the owning device has set. + private UniquePtr allocation; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The size in bytes of each buffer item (including padding, if any). + /// The resource type for the current buffer. + /// The allocation mode to use for the new resource. + private protected Buffer(GraphicsDevice device, int length, uint elementSizeInBytes, ResourceType resourceType, AllocationMode allocationMode) + { + device.ThrowIfDisposed(); + + if (resourceType == ResourceType.Constant) + { + Guard.IsBetweenOrEqualTo(length, 1, FX.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length)); + } + else + { + // The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue + Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / elementSizeInBytes) & ~255, nameof(length)); + } + + SizeInBytes = checked((nint)(length * elementSizeInBytes)); + GraphicsDevice = device; + Length = length; + + if (device.IsCacheCoherentUMA) + { + this.d3D12Resource = device.D3D12Device->CreateCommittedResource(resourceType, allocationMode, (ulong)SizeInBytes, true); + } + else + { + this.allocation = device.Allocator->CreateResource(resourceType, allocationMode, (ulong)SizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); + } + + device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); + + switch (resourceType) + { + case ResourceType.Constant: + device.D3D12Device->CreateConstantBufferView(this.d3D12Resource.Get(), SizeInBytes, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadOnly: + device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), (uint)length, elementSizeInBytes, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadWrite: + device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), (uint)length, elementSizeInBytes, D3D12CpuDescriptorHandle); + break; + } + + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the length of the current buffer. + /// + public int Length { get; } + + /// + /// Gets whether or not there is some padding between elements in the current buffer. + /// + internal bool IsPaddingPresent + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => SizeInBytes > (nint)Length * sizeof(T); + } + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target memory area. + /// + /// The input memory area to write data to. + /// The length of the memory area to write data to. + /// The offset to start reading data from. + internal abstract void CopyTo(ref T destination, int length, int offset); + + /// + /// Writes the contents of a given memory area to a specified area of the current instance. + /// + /// The input memory area to read data from. + /// The length of the input memory area to read data from. + /// The offset to start writing data to. + internal abstract void CopyFrom(ref T source, int length, int offset); + + /// + /// Writes the contents of a given to the current instance. + /// + /// The input to read data from. + public abstract void CopyFrom(Buffer source); + + /// + /// Writes the contents of a given to the current instance, using a temporary CPU buffer. + /// + /// The input to read data from. + protected void CopyFromWithCpuBuffer(Buffer source) + { + T[] array = ArrayPool.Shared.Rent(source.Length); + + try + { + ref T r0 = ref MemoryMarshal.GetArrayDataReference(array); + + source.CopyTo(ref r0, source.Length, 0); + + CopyFrom(ref r0, source.Length, 0); + } + finally + { + ArrayPool.Shared.Return(array); + } + } + + /// + protected override bool OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice?.IsDisposed == false) + { + GraphicsDevice.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); + } + + return true; + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs new file mode 100644 index 00000000..1266141d --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs @@ -0,0 +1,249 @@ +using ComputeSharp.Graphics.Commands; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Graphics.Helpers; +using ComputeSharp.Graphics.Resources.Interop; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +namespace ComputeSharp.Resources +{ + /// + /// A representing a typed structured buffer stored on GPU memory. + /// + /// The type of items stored on the buffer. + public abstract class StructuredBuffer : Buffer + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The buffer type for the current buffer. + /// The allocation mode to use for the new resource. + private protected unsafe StructuredBuffer(GraphicsDevice device, int length, ResourceType resourceType, AllocationMode allocationMode) + : base(device, length, (uint)sizeof(T), resourceType, allocationMode) + { + } + + /// + internal override unsafe void CopyTo(ref T destination, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) + { + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + fixed (void* destinationPointer = &destination) + { + MemoryHelper.Copy( + resource.Pointer, + (uint)offset, + (uint)length, + (uint)sizeof(T), + destinationPointer); + } + } + else + { + nint + byteOffset = (nint)offset * sizeof(T), + byteLength = length * sizeof(T); + + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource(ResourceType.ReadBack, AllocationMode.Default, (ulong)byteLength); + + using (CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY)) + { + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(allocation.Get()->GetResource(), 0, D3D12Resource, (ulong)byteOffset, (ulong)byteLength); + copyCommandList.ExecuteAndWaitForCompletion(); + } + + using ID3D12ResourceMap resource = allocation.Get()->GetResource()->Map(); + + fixed (void* destinationPointer = &destination) + { + MemoryHelper.Copy( + resource.Pointer, + 0u, + (uint)length, + (uint)sizeof(T), + destinationPointer); + } + } + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target instance. + /// + /// The target instance to write data to. + /// The starting offset within to write data to. + /// The number of items to read. + /// The offset to start reading data from. + internal unsafe void CopyTo(ReadBackBuffer destination, int destinationOffset, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + destination.ThrowIfDeviceMismatch(GraphicsDevice); + destination.ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + Guard.IsInRange(destinationOffset, 0, destination.Length, nameof(destinationOffset)); + Guard.IsLessThanOrEqualTo(destinationOffset + length, destination.Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) + { + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + MemoryHelper.Copy( + resource.Pointer, + (uint)offset, + (uint)length, + (uint)sizeof(T), + destination.MappedData + destinationOffset); + } + else + { + ulong + byteDestinationOffset = (uint)destinationOffset * (uint)sizeof(T), + byteOffset = (uint)offset * (uint)sizeof(T), + byteLength = (uint)length * (uint)sizeof(T); + + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(destination.D3D12Resource, byteDestinationOffset, D3D12Resource, byteOffset, byteLength); + copyCommandList.ExecuteAndWaitForCompletion(); + } + } + + /// + internal override unsafe void CopyFrom(ref T source, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) + { + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + (uint)offset, + (uint)length, + (uint)sizeof(T), + resource.Pointer); + } + } + else + { + nint + byteOffset = (nint)offset * sizeof(T), + byteLength = length * sizeof(T); + + using UniquePtr allocation = GraphicsDevice.Allocator->CreateResource(ResourceType.Upload, AllocationMode.Default, (ulong)byteLength); + + using (ID3D12ResourceMap resource = allocation.Get()->GetResource()->Map()) + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + 0u, + (uint)length, + (uint)sizeof(T), + resource.Pointer); + } + + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, (ulong)byteOffset, allocation.Get()->GetResource(), 0, (ulong)byteLength); + copyCommandList.ExecuteAndWaitForCompletion(); + } + } + + /// + /// Reads the contents of the specified range from an input instance and writes them to the current the current instance. + /// + /// The input instance to read data from. + /// The starting offset within to read data from. + /// The number of items to read. + /// The offset to start reading writing data to. + internal unsafe void CopyFrom(UploadBuffer source, int sourceOffset, int length, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + length, Length, nameof(length)); + Guard.IsInRange(sourceOffset, 0, source.Length, nameof(sourceOffset)); + Guard.IsLessThanOrEqualTo(sourceOffset + length, source.Length, nameof(length)); + + if (GraphicsDevice.IsCacheCoherentUMA) + { + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + MemoryHelper.Copy( + source.MappedData, + (uint)sourceOffset, + (uint)length, + (uint)sizeof(T), + (T*)resource.Pointer + offset); + } + else + { + ulong + byteSourceOffset = (uint)sourceOffset * (uint)sizeof(T), + byteOffset = (uint)offset * (uint)sizeof(T), + byteLength = (uint)length * (uint)sizeof(T); + + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, byteOffset, source.D3D12Resource, byteSourceOffset, byteLength); + copyCommandList.ExecuteAndWaitForCompletion(); + } + } + + /// + public override unsafe void CopyFrom(Buffer source) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsLessThanOrEqualTo(source.Length, Length, nameof(Length)); + + if (!source.IsPaddingPresent) + { + // Directly copy the input buffer + using CommandList copyCommandList = new(GraphicsDevice, D3D12_COMMAND_LIST_TYPE_COPY); + + copyCommandList.D3D12GraphicsCommandList->CopyBufferRegion(D3D12Resource, 0, source.D3D12Resource, 0,(ulong)SizeInBytes); + copyCommandList.ExecuteAndWaitForCompletion(); + } + else CopyFromWithCpuBuffer(source); + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs new file mode 100644 index 00000000..5cfdce19 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Abstract/Texture2D{T}.cs @@ -0,0 +1,492 @@ +using System.Runtime.CompilerServices; +using ComputeSharp.__Internals; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Commands; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Graphics.Helpers; +using ComputeSharp.Graphics.Resources.Interop; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; +using static TerraFX.Interop.D3D12_RESOURCE_STATES; +using static TerraFX.Interop.D3D12_SRV_DIMENSION; +using static TerraFX.Interop.D3D12_UAV_DIMENSION; +using FX = TerraFX.Interop.Windows; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +#pragma warning disable CS0618 + +namespace ComputeSharp.Resources +{ + /// + /// A representing a typed 2D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + public unsafe abstract class Texture2D : NativeObject, GraphicsResourceHelper.IGraphicsResource + where T : unmanaged + { + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The instance for the current resource. + /// + private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; + + /// + /// The instance for the current resource. + /// + internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; + + /// + /// The default value for the current resource. + /// + private readonly D3D12_RESOURCE_STATES d3D12ResourceState; + + /// + /// The value to use for copy operations. + /// + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// The instance used to retrieve , if any. + /// + /// This will be if the owning device has set. + private UniquePtr allocation; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + /// The format support for the current texture type. + private protected Texture2D(GraphicsDevice device, int width, int height, ResourceType resourceType, AllocationMode allocationMode, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport) + { + device.ThrowIfDisposed(); + + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height)); + + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), d3D12FormatSupport)) + { + UnsupportedTextureTypeException.ThrowForTexture2D(); + } + + GraphicsDevice = device; + + if (device.IsCacheCoherentUMA) + { + this.d3D12Resource = device.D3D12Device->CreateCommittedResource( + resourceType, + allocationMode, + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + true, + out this.d3D12ResourceState); + } + else + { + this.allocation = device.Allocator->CreateResource( + resourceType, + allocationMode, + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out this.d3D12ResourceState); + + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); + } + + this.d3D12CommandListType = this.d3D12ResourceState == D3D12_RESOURCE_STATE_COMMON + ? D3D12_COMMAND_LIST_TYPE_COPY + : D3D12_COMMAND_LIST_TYPE_COMPUTE; + + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out this.d3D12PlacedSubresourceFootprint, + out _, + out _); + + device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); + + switch (resourceType) + { + case ResourceType.ReadOnly: + device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_SRV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadWrite: + device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_UAV_DIMENSION_TEXTURE2D, D3D12CpuDescriptorHandle); + break; + } + + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target memory area. + /// + /// The target memory area to write data to. + /// The size of the target memory area to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + internal void CopyTo(ref T destination, int size, int x, int y, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size)); + + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintDestination, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = default; + using ComPtr d3D12Resource = default; + + if (GraphicsDevice.IsCacheCoherentUMA) + { + *&d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource(ResourceType.ReadBack, AllocationMode.Default, totalSizeInBytes, true); + } + else + { + *&allocation = GraphicsDevice.Allocator->CreateResource(ResourceType.ReadBack, AllocationMode.Default, totalSizeInBytes); + *&d3D12Resource = new ComPtr(allocation.Get()->GetResource()); + } + + using (CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType)) + { + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); + } + + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintDestination, + destinationX: 0, + destinationY: 0, + destinationZ: 0, + d3D12ResourceSource: D3D12Resource, + sourceX: (uint)x, + sourceY: (uint)y, + sourceZ: 0, + (uint)width, + (uint)height, + depth: 1); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + using ID3D12ResourceMap resource = d3D12Resource.Get()->Map(); + + fixed (void* destinationPointer = &destination) + { + MemoryHelper.Copy( + resource.Pointer, + (uint)height, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch, + destinationPointer); + } + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target instance. + /// + /// The target instance to write data to. + /// The horizontal offset within . + /// The vertical offset within . + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + internal void CopyTo(ReadBackTexture2D destination, int destinationX, int destinationY, int sourceX, int sourceY, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + destination.ThrowIfDeviceMismatch(GraphicsDevice); + destination.ThrowIfDisposed(); + + Guard.IsInRange(destinationX, 0, destination.Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, destination.Height, nameof(destinationY)); + Guard.IsInRange(sourceX, 0, Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, Height, nameof(sourceY)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height)); + Guard.IsBetweenOrEqualTo(destinationX + width, 1, destination.Width, nameof(destinationX)); + Guard.IsBetweenOrEqualTo(destinationY + height, 1, destination.Height, nameof(destinationY)); + Guard.IsLessThanOrEqualTo(sourceX + width, Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, Height, nameof(sourceY)); + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination = &destination.D3D12PlacedSubresourceFootprint) + { + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: destination.D3D12Resource, + d3D12PlacedSubresourceFootprintDestination, + (uint)destinationX, + (uint)destinationY, + destinationZ: 0, + d3D12ResourceSource: D3D12Resource, + (uint)sourceX, + (uint)sourceY, + sourceZ: 0, + (uint)width, + (uint)height, + 1); + } + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Writes the contents of a given memory area to a specified area of the current instance. + /// + /// The input memory area to read data from. + /// The size of the memory area to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + internal void CopyFrom(ref T source, int size, int x, int y, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height, nameof(size)); + + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintSource, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = default; + using ComPtr d3D12Resource = default; + + if (GraphicsDevice.IsCacheCoherentUMA) + { + *&d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource(ResourceType.Upload, AllocationMode.Default, totalSizeInBytes, true); + } + else + { + *&allocation = GraphicsDevice.Allocator->CreateResource(ResourceType.Upload, AllocationMode.Default, totalSizeInBytes); + *&d3D12Resource = new ComPtr(allocation.Get()->GetResource()); + } + + using (ID3D12ResourceMap resource = d3D12Resource.Get()->Map()) + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + resource.Pointer, + (uint)height, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch); + } + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); + } + + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: D3D12Resource, + destinationX: (uint)x, + destinationY: (uint)y, + destinationZ: 0, + d3D12ResourceSource: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintSource, + sourceX: 0, + sourceY: 0, + sourceZ: 0, + (uint)width, + (uint)height, + depth: 1); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Writes the contents of a given instance to a specified area of the current instance. + /// + /// The input instance to read data from. + /// The horizontal offset within . + /// The vertical offset within . + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + internal void CopyFrom(UploadTexture2D source, int sourceX, int sourceY, int destinationX, int destinationY, int width, int height) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsInRange(sourceX, 0, source.Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, source.Height, nameof(sourceY)); + Guard.IsInRange(destinationX, 0, Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, Height, nameof(destinationY)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height)); + Guard.IsLessThanOrEqualTo(sourceX + width, source.Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, source.Height, nameof(sourceY)); + Guard.IsLessThanOrEqualTo(destinationX + width, Width, nameof(destinationX)); + Guard.IsLessThanOrEqualTo(destinationY + height, Height, nameof(destinationY)); + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource = &source.D3D12PlacedSubresourceFootprint) + { + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: D3D12Resource, + (uint)destinationX, + (uint)destinationY, + destinationZ: 0, + d3D12ResourceSource: source.D3D12Resource, + d3D12PlacedSubresourceFootprintSource, + (uint)sourceX, + (uint)sourceY, + sourceZ: 0, + (uint)width, + (uint)height, + depth: 1); + } + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + protected override bool OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice?.IsDisposed == false) + { + GraphicsDevice.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); + } + + return true; + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + + /// + D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device) + { + ThrowIfDisposed(); + ThrowIfDeviceMismatch(device); + + return D3D12GpuDescriptorHandle; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs new file mode 100644 index 00000000..f29c2db8 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Abstract/Texture3D{T}.cs @@ -0,0 +1,536 @@ +using System.Runtime.CompilerServices; +using ComputeSharp.__Internals; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Commands; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Graphics.Helpers; +using ComputeSharp.Graphics.Resources.Interop; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; +using static TerraFX.Interop.D3D12_RESOURCE_STATES; +using static TerraFX.Interop.D3D12_SRV_DIMENSION; +using static TerraFX.Interop.D3D12_UAV_DIMENSION; +using FX = TerraFX.Interop.Windows; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +#pragma warning disable CS0618 + +namespace ComputeSharp.Resources +{ + /// + /// A representing a typed 3D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + public unsafe abstract class Texture3D : NativeObject, GraphicsResourceHelper.IGraphicsResource + where T : unmanaged + { + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The instance for the current resource. + /// + private readonly D3D12_CPU_DESCRIPTOR_HANDLE D3D12CpuDescriptorHandle; + + /// + /// The instance for the current resource. + /// + internal readonly D3D12_GPU_DESCRIPTOR_HANDLE D3D12GpuDescriptorHandle; + + /// + /// The default value for the current resource. + /// + private readonly D3D12_RESOURCE_STATES d3D12ResourceState; + + /// + /// The value to use for copy operations. + /// + private readonly D3D12_COMMAND_LIST_TYPE d3D12CommandListType; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// The instance used to retrieve , if any. + /// + /// This will be if the owning device has set. + private UniquePtr allocation; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The depth of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + /// The format support for the current texture type. + private protected Texture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType, AllocationMode allocationMode, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport) + { + device.ThrowIfDisposed(); + + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth)); + + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), d3D12FormatSupport)) + { + UnsupportedTextureTypeException.ThrowForTexture2D(); + } + + GraphicsDevice = device; + + if (device.IsCacheCoherentUMA) + { + this.d3D12Resource = device.D3D12Device->CreateCommittedResource( + resourceType, + allocationMode, + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + true, + out this.d3D12ResourceState); + } + else + { + this.allocation = device.Allocator->CreateResource( + resourceType, + allocationMode, + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out this.d3D12ResourceState); + + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); + } + + this.d3D12CommandListType = this.d3D12ResourceState == D3D12_RESOURCE_STATE_COMMON + ? D3D12_COMMAND_LIST_TYPE_COPY + : D3D12_COMMAND_LIST_TYPE_COMPUTE; + + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out this.d3D12PlacedSubresourceFootprint, + out _, + out _); + + device.RentShaderResourceViewDescriptorHandles(out D3D12CpuDescriptorHandle, out D3D12GpuDescriptorHandle); + + switch (resourceType) + { + case ResourceType.ReadOnly: + device.D3D12Device->CreateShaderResourceView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_SRV_DIMENSION_TEXTURE3D, D3D12CpuDescriptorHandle); + break; + case ResourceType.ReadWrite: + device.D3D12Device->CreateUnorderedAccessView(this.d3D12Resource.Get(), DXGIFormatHelper.GetForType(), D3D12_UAV_DIMENSION_TEXTURE3D, D3D12CpuDescriptorHandle); + break; + } + + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + + /// + /// Gets the depth of the current texture. + /// + public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Reads the contents of the specified range from the current instance and writes them into a target memory area. + /// + /// The target memory area to write data to. + /// The size of the memory area to write data to. + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + internal void CopyTo(ref T destination, int size, int x, int y, int z, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsInRange(z, 0, Depth, nameof(z)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size)); + + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintDestination, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = default; + using ComPtr d3D12Resource = default; + + if (GraphicsDevice.IsCacheCoherentUMA) + { + *&d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource(ResourceType.ReadBack, AllocationMode.Default, totalSizeInBytes, true); + } + else + { + *&allocation = GraphicsDevice.Allocator->CreateResource(ResourceType.ReadBack, AllocationMode.Default, totalSizeInBytes); + *&d3D12Resource = new ComPtr(allocation.Get()->GetResource()); + } + + using (CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType)) + { + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); + } + + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintDestination, + destinationX: 0, + destinationY: 0, + destinationZ: 0, + d3D12ResourceSource: D3D12Resource, + sourceX: (uint)x, + sourceY: (uint)y, + sourceZ: (ushort)z, + (uint)width, + (uint)height, + (ushort)depth); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + using ID3D12ResourceMap resource = d3D12Resource.Get()->Map(); + + fixed (void* destinationPointer = &destination) + { + MemoryHelper.Copy( + resource.Pointer, + (uint)height, + (uint)depth, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch, + d3D12PlacedSubresourceFootprintDestination.Footprint.RowPitch * (uint)height, + destinationPointer); + } + } + + /// + /// Reads the contents of the specified range from the current instance and writes them into a instance. + /// + /// The target instance to write data to. + /// The horizontal offset within . + /// The vertical offset within . + /// The depthwise offset within . + /// The horizontal offset in the source texture. + /// The vertical offset in the source texture. + /// The depthwise offset in the source texture. + /// The width of the memory area to copy. + /// The height of the memory area to copy. + /// The depth of the memory area to copy. + internal void CopyTo(ReadBackTexture3D destination, int destinationX, int destinationY, int destinationZ, int sourceX, int sourceY, int sourceZ, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + destination.ThrowIfDeviceMismatch(GraphicsDevice); + destination.ThrowIfDisposed(); + + Guard.IsInRange(destinationX, 0, destination.Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, destination.Height, nameof(destinationY)); + Guard.IsInRange(destinationZ, 0, destination.Depth, nameof(destinationZ)); + Guard.IsInRange(sourceX, 0, Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, Height, nameof(sourceY)); + Guard.IsInRange(sourceZ, 0, Depth, nameof(sourceZ)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(width, 1, destination.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, destination.Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, destination.Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(destinationX + width, 1, destination.Width, nameof(destinationX)); + Guard.IsBetweenOrEqualTo(destinationY + height, 1, destination.Height, nameof(destinationY)); + Guard.IsBetweenOrEqualTo(destinationZ + depth, 1, destination.Depth, nameof(destinationZ)); + Guard.IsLessThanOrEqualTo(sourceX + width, Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, Height, nameof(sourceY)); + Guard.IsLessThanOrEqualTo(sourceZ + depth, Depth, nameof(sourceZ)); + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_SOURCE); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintDestination = &destination.D3D12PlacedSubresourceFootprint) + { + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: destination.D3D12Resource, + d3D12PlacedSubresourceFootprintDestination, + (uint)destinationX, + (uint)destinationY, + (ushort)destinationZ, + d3D12ResourceSource: D3D12Resource, + (uint)sourceX, + (uint)sourceY, + (ushort)sourceZ, + (uint)width, + (uint)height, + (ushort)depth); + } + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_SOURCE, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Writes the contents of a given memory area to a specified area of the current instance. + /// + /// The input memory area to read data from. + /// The size of the memory area to read data from. + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + internal void CopyFrom(ref T source, int size, int x, int y, int z, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(x, 0, Width, nameof(x)); + Guard.IsInRange(y, 0, Height, nameof(y)); + Guard.IsInRange(z, 0, Depth, nameof(z)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); + Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); + Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z)); + Guard.IsGreaterThanOrEqualTo(size, (nint)width * height * depth, nameof(size)); + + GraphicsDevice.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprintSource, + out ulong rowSizeInBytes, + out ulong totalSizeInBytes); + + using UniquePtr allocation = default; + using ComPtr d3D12Resource = default; + + if (GraphicsDevice.IsCacheCoherentUMA) + { + *&d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource(ResourceType.Upload, AllocationMode.Default, totalSizeInBytes, true); + } + else + { + *&allocation = GraphicsDevice.Allocator->CreateResource(ResourceType.Upload, AllocationMode.Default, totalSizeInBytes); + *&d3D12Resource = new ComPtr(allocation.Get()->GetResource()); + } + + using (ID3D12ResourceMap resource = d3D12Resource.Get()->Map()) + fixed (void* sourcePointer = &source) + { + MemoryHelper.Copy( + sourcePointer, + resource.Pointer, + (uint)height, + (uint)depth, + rowSizeInBytes, + d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch, + d3D12PlacedSubresourceFootprintSource.Footprint.RowPitch * (uint)height); + } + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); + } + + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: D3D12Resource, + destinationX: (uint)x, + destinationY: (uint)y, + destinationZ: (ushort)z, + d3D12ResourceSource: d3D12Resource.Get(), + &d3D12PlacedSubresourceFootprintSource, + sourceX: 0, + sourceY: 0, + sourceZ: 0, + (uint)width, + (uint)height, + (ushort)depth); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Writes the contents of a given instance to a specified area of the current instance. + /// + /// The input instance to read data from. + /// The horizontal offset within . + /// The vertical offset within . + /// The depthwise offset within . + /// The horizontal offset in the destination texture. + /// The vertical offset in the destination texture. + /// The depthwise offset in the destination texture. + /// The width of the memory area to write to. + /// The height of the memory area to write to. + /// The depth of the memory area to write to. + internal void CopyFrom(UploadTexture3D source, int sourceX, int sourceY, int sourceZ, int destinationX, int destinationY, int destinationZ, int width, int height, int depth) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsInRange(sourceX, 0, source.Width, nameof(sourceX)); + Guard.IsInRange(sourceY, 0, source.Height, nameof(sourceY)); + Guard.IsInRange(sourceZ, 0, source.Depth, nameof(sourceZ)); + Guard.IsInRange(destinationX, 0, Width, nameof(destinationX)); + Guard.IsInRange(destinationY, 0, Height, nameof(destinationY)); + Guard.IsInRange(destinationZ, 0, Depth, nameof(destinationZ)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(width, 1, source.Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, source.Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, source.Depth, nameof(depth)); + Guard.IsLessThanOrEqualTo(sourceX + width, source.Width, nameof(sourceX)); + Guard.IsLessThanOrEqualTo(sourceY + height, source.Height, nameof(sourceY)); + Guard.IsLessThanOrEqualTo(sourceZ + depth, source.Depth, nameof(sourceZ)); + Guard.IsLessThanOrEqualTo(destinationX + width, Width, nameof(destinationX)); + Guard.IsLessThanOrEqualTo(destinationY + height, Height, nameof(destinationY)); + Guard.IsLessThanOrEqualTo(destinationZ + depth, Depth, nameof(destinationZ)); + + using CommandList copyCommandList = new(GraphicsDevice, this.d3D12CommandListType); + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, this.d3D12ResourceState, D3D12_RESOURCE_STATE_COPY_DEST); + } + + fixed (D3D12_PLACED_SUBRESOURCE_FOOTPRINT* d3D12PlacedSubresourceFootprintSource = &source.D3D12PlacedSubresourceFootprint) + { + copyCommandList.D3D12GraphicsCommandList->CopyTextureRegion( + d3D12ResourceDestination: D3D12Resource, + (uint)destinationX, + (uint)destinationY, + (ushort)destinationZ, + d3D12ResourceSource: source.D3D12Resource, + d3D12PlacedSubresourceFootprintSource, + (uint)sourceX, + (uint)sourceY, + (ushort)sourceZ, + (uint)width, + (uint)height, + (ushort)depth); + } + + if (copyCommandList.D3D12CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE) + { + copyCommandList.D3D12GraphicsCommandList->ResourceBarrier(D3D12Resource, D3D12_RESOURCE_STATE_COPY_DEST, this.d3D12ResourceState); + } + + copyCommandList.ExecuteAndWaitForCompletion(); + } + + /// + protected override bool OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + if (GraphicsDevice?.IsDisposed == false) + { + GraphicsDevice.ReturnShaderResourceViewDescriptorHandles(D3D12CpuDescriptorHandle, D3D12GpuDescriptorHandle); + } + + return true; + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + + /// + D3D12_GPU_DESCRIPTOR_HANDLE GraphicsResourceHelper.IGraphicsResource.ValidateAndGetGpuDescriptorHandle(GraphicsDevice device) + { + ThrowIfDisposed(); + ThrowIfDeviceMismatch(device); + + return D3D12GpuDescriptorHandle; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs new file mode 100644 index 00000000..66887f0c --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferBuffer{T}.cs @@ -0,0 +1,187 @@ +using System; +using System.Buffers; +using System.Runtime.CompilerServices; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +namespace ComputeSharp.Resources +{ + /// + /// A representing a typed buffer stored on CPU memory, that can be used to transfer data to/from the GPU. + /// + /// The type of items stored on the buffer. + public abstract unsafe class TransferBuffer : NativeObject, IMemoryOwner + where T : unmanaged + { + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The pointer to the start of the mapped buffer data. + /// + private readonly T* mappedData; + + /// + /// The instance used to retrieve , if any. + /// + /// This will be if the owning device has set. + private UniquePtr allocation; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The resource type for the current buffer. + /// The allocation mode to use for the new resource. + private protected TransferBuffer(GraphicsDevice device, int length, ResourceType resourceType, AllocationMode allocationMode) + { + device.ThrowIfDisposed(); + + // The maximum length is set such that the aligned buffer size can't exceed uint.MaxValue + Guard.IsBetweenOrEqualTo(length, 1, (uint.MaxValue / (uint)sizeof(T)) & ~255, nameof(length)); + + GraphicsDevice = device; + Length = length; + + ulong sizeInBytes = (uint)length * (uint)sizeof(T); + + if (device.IsCacheCoherentUMA) + { + this.d3D12Resource = device.D3D12Device->CreateCommittedResource(resourceType, allocationMode, sizeInBytes, true); + } + else + { + this.allocation = device.Allocator->CreateResource(resourceType, allocationMode, sizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); + } + + this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; + + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the length of the current buffer. + /// + public int Length { get; } + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Gets the pointer to the start of the mapped buffer data. + /// + internal T* MappedData => this.mappedData; + + /// + public Memory Memory + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ThrowIfDisposed(); + + return new MemoryManager(this).Memory; + } + } + + /// + public Span Span + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ThrowIfDisposed(); + + return new(this.mappedData, Length); + } + } + + /// + protected override bool OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + return true; + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + + /// + /// A implementation wrapping a instance. + /// + private sealed class MemoryManager : MemoryManager + { + /// + /// The in use. + /// + private readonly TransferBuffer buffer; + + /// + /// Creates a new instance for a given buffer. + /// + /// The in use. + public MemoryManager(TransferBuffer buffer) + { + this.buffer = buffer; + } + + /// + public override Memory Memory + { + get => CreateMemory(this.buffer.Length); + } + + /// + public override Span GetSpan() + { + return this.buffer.Span; + } + + /// + public override MemoryHandle Pin(int elementIndex = 0) + { + Guard.IsEqualTo(elementIndex, 0, nameof(elementIndex)); + + this.buffer.ThrowIfDisposed(); + + return new(this.buffer.mappedData); + } + + /// + public override void Unpin() + { + } + + /// + protected override void Dispose(bool disposing) + { + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs new file mode 100644 index 00000000..4a5e2d61 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture2D{T}.cs @@ -0,0 +1,145 @@ +using System.Runtime.CompilerServices; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Graphics.Helpers; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; +using FX = TerraFX.Interop.Windows; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +namespace ComputeSharp.Resources +{ + /// + /// A representing a typed 2D texture stored on on CPU memory, that can be used to transfer data to/from the GPU. + /// + /// The type of items stored on the texture. + public unsafe abstract class TransferTexture2D : NativeObject + where T : unmanaged + { + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The pointer to the start of the mapped buffer data. + /// + private readonly T* mappedData; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// The instance used to retrieve , if any. + /// + /// This will be if the owning device has set. + private UniquePtr allocation; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + private protected TransferTexture2D(GraphicsDevice device, int width, int height, ResourceType resourceType, AllocationMode allocationMode) + { + device.ThrowIfDisposed(); + + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height)); + + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE2D)) + { + UnsupportedTextureTypeException.ThrowForTexture2D(); + } + + GraphicsDevice = device; + + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + out this.d3D12PlacedSubresourceFootprint, + out _, + out ulong totalSizeInBytes); + + if (device.IsCacheCoherentUMA) + { + this.d3D12Resource = device.D3D12Device->CreateCommittedResource(resourceType, allocationMode, totalSizeInBytes, true); + } + else + { + this.allocation = device.Allocator->CreateResource(resourceType, allocationMode, totalSizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); + } + + this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; + + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Gets the value for the current resource. + /// + internal ref readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT D3D12PlacedSubresourceFootprint => ref this.d3D12PlacedSubresourceFootprint; + + /// + public TextureView2D View + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ThrowIfDisposed(); + + return new(this.mappedData, Width, Height, (int)this.d3D12PlacedSubresourceFootprint.Footprint.RowPitch); + } + } + + /// + protected override bool OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + return true; + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs new file mode 100644 index 00000000..42e4b092 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Abstract/TransferTexture3D{T}.cs @@ -0,0 +1,152 @@ +using System.Runtime.CompilerServices; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Graphics.Helpers; +using ComputeSharp.Interop; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; +using FX = TerraFX.Interop.Windows; +using ResourceType = ComputeSharp.Graphics.Resources.Enums.ResourceType; + +namespace ComputeSharp.Resources +{ + /// + /// A representing a typed 3D texture stored on on CPU memory, that can be used to transfer data to/from the GPU. + /// + /// The type of items stored on the texture. + public unsafe abstract class TransferTexture3D : NativeObject + where T : unmanaged + { + /// + /// The instance currently mapped. + /// + private ComPtr d3D12Resource; + + /// + /// The pointer to the start of the mapped buffer data. + /// + private readonly T* mappedData; + + /// + /// The description for the current resource. + /// + private readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT d3D12PlacedSubresourceFootprint; + + /// + /// The instance used to retrieve , if any. + /// + /// This will be if the owning device has set. + private UniquePtr allocation; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The height of the texture. + /// The width of the texture. + /// The depth of the texture. + /// The resource type for the current texture. + /// The allocation mode to use for the new resource. + private protected TransferTexture3D(GraphicsDevice device, int width, int height, int depth, ResourceType resourceType, AllocationMode allocationMode) + { + device.ThrowIfDisposed(); + + Guard.IsBetweenOrEqualTo(width, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, FX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth)); + + if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType(), D3D12_FORMAT_SUPPORT1_TEXTURE3D)) + { + UnsupportedTextureTypeException.ThrowForTexture2D(); + } + + GraphicsDevice = device; + + device.D3D12Device->GetCopyableFootprint( + DXGIFormatHelper.GetForType(), + (uint)width, + (uint)height, + (ushort)depth, + out this.d3D12PlacedSubresourceFootprint, + out _, + out ulong totalSizeInBytes); + + if (device.IsCacheCoherentUMA) + { + this.d3D12Resource = device.D3D12Device->CreateCommittedResource(resourceType, allocationMode, totalSizeInBytes, true); + } + else + { + this.allocation = device.Allocator->CreateResource(resourceType, allocationMode, totalSizeInBytes); + this.d3D12Resource = new ComPtr(this.allocation.Get()->GetResource()); + } + + this.mappedData = (T*)this.d3D12Resource.Get()->Map().Pointer; + + this.d3D12Resource.Get()->SetName(this); + } + + /// + /// Gets the associated with the current instance. + /// + public GraphicsDevice GraphicsDevice { get; } + + /// + /// Gets the width of the current texture. + /// + public int Width => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Width; + + /// + /// Gets the height of the current texture. + /// + public int Height => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Height; + /// + /// Gets the depth of the current texture. + /// + public int Depth => (int)this.d3D12PlacedSubresourceFootprint.Footprint.Depth; + + /// + /// Gets the instance currently mapped. + /// + internal ID3D12Resource* D3D12Resource => this.d3D12Resource; + + /// + /// Gets the value for the current resource. + /// + internal ref readonly D3D12_PLACED_SUBRESOURCE_FOOTPRINT D3D12PlacedSubresourceFootprint => ref this.d3D12PlacedSubresourceFootprint; + + /// + public TextureView3D View + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ThrowIfDisposed(); + + return new(this.mappedData, Width, Height, Depth, (int)this.d3D12PlacedSubresourceFootprint.Footprint.RowPitch); + } + } + + /// + protected override bool OnDispose() + { + this.d3D12Resource.Dispose(); + this.allocation.Dispose(); + + return true; + } + + /// + /// Throws a if the target device doesn't match the current one. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void ThrowIfDeviceMismatch(GraphicsDevice device) + { + if (GraphicsDevice != device) + { + GraphicsDeviceMismatchException.Throw(this, device); + } + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ConstantBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ConstantBuffer{T}.cs new file mode 100644 index 00000000..96d673af --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ConstantBuffer{T}.cs @@ -0,0 +1,176 @@ +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using ComputeSharp.Core.Helpers; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Graphics.Helpers; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Graphics.Resources.Interop; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using Microsoft.Toolkit.Diagnostics; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp +{ + /// + /// A representing a typed read write buffer stored on GPU memory. + /// + /// The type of items stored on the buffer. + [DebuggerTypeProxy(typeof(BufferDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ConstantBuffer : Buffer + where T : unmanaged + { + /// + /// The alignment boundary for elements in a constant buffer. + /// + private const int ElementAlignment = FX.D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ConstantBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, (uint)GetPaddedSize(), ResourceType.Constant, allocationMode) + { + } + + /// + /// Gets a single value from the current constant buffer. + /// + /// The index of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int i] => throw new InvalidExecutionContextException($"{nameof(ConstantBuffer)}[int]"); + + /// + /// Gets the right padded size for elements to store in the current instance. + /// + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static unsafe int GetPaddedSize() + { + return AlignmentHelper.Pad(sizeof(T), ElementAlignment); + } + + /// + internal override unsafe void CopyTo(ref T destination, int size, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + size, Length, nameof(size)); + + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + fixed (void* destinationPointer = &destination) + { + if (IsPaddingPresent) + { + MemoryHelper.Copy( + resource.Pointer, + (uint)offset, + (uint)size, + (uint)GetPaddedSize(), + destinationPointer); + } + else + { + MemoryHelper.Copy( + resource.Pointer, + (uint)offset, + (uint)size, + (uint)sizeof(T), + destinationPointer); + } + } + } + + /// + internal override unsafe void CopyFrom(ref T source, int size, int offset) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + Guard.IsInRange(offset, 0, Length, nameof(offset)); + Guard.IsLessThanOrEqualTo(offset + size, Length, nameof(size)); + + using ID3D12ResourceMap resource = D3D12Resource->Map(); + + fixed (void* sourcePointer = &source) + { + if (IsPaddingPresent) + { + MemoryHelper.Copy( + sourcePointer, + resource.Pointer, + (uint)offset, + (uint)size, + (uint)GetPaddedSize(), + isPaddingInSourceToo: false); + } + else + { + MemoryHelper.Copy( + sourcePointer, + (uint)offset, + (uint)size, + (uint)sizeof(T), + resource.Pointer); + } + } + } + + /// + public override unsafe void CopyFrom(Buffer source) + { + GraphicsDevice.ThrowIfDisposed(); + + ThrowIfDisposed(); + + source.ThrowIfDeviceMismatch(GraphicsDevice); + source.ThrowIfDisposed(); + + Guard.IsLessThanOrEqualTo(source.Length, Length, nameof(Length)); + + if (source is ConstantBuffer buffer) + { + using ID3D12ResourceMap sourceMap = buffer.D3D12Resource->Map(); + using ID3D12ResourceMap destinationMap = D3D12Resource->Map(); + + if (IsPaddingPresent) + { + MemoryHelper.Copy( + sourceMap.Pointer, + destinationMap.Pointer, + 0, + (uint)source.Length, + (uint)GetPaddedSize(), + isPaddingInSourceToo: true); + } + else + { + MemoryHelper.Copy( + sourceMap.Pointer, + 0, + (uint)source.Length, + (uint)sizeof(T), + destinationMap.Pointer); + } + } + else CopyFromWithCpuBuffer(source); + } + + /// + public override string ToString() + { + return $"ComputeSharp.ConstantBuffer<{typeof(T)}>[{Length}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs new file mode 100644 index 00000000..882298e6 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Debug/BufferDebugView{T}.cs @@ -0,0 +1,35 @@ +using System; +using System.Diagnostics; + +namespace ComputeSharp.Resources.Debug +{ + /// + /// A debug proxy used to display items in a instance. + /// + /// The type of items to display. + internal sealed class BufferDebugView + where T : unmanaged + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance with the items to display. + public BufferDebugView(Buffer? buffer) + { + if (buffer is not null) + { + var items = GC.AllocateUninitializedArray(buffer.Length); + + buffer.CopyTo(ref items[0], buffer.Length, 0); + + Items = items; + } + } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[]? Items { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Debug/Texture2DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/Texture2DDebugView{T}.cs new file mode 100644 index 00000000..31874e62 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Debug/Texture2DDebugView{T}.cs @@ -0,0 +1,34 @@ +using System.Diagnostics; + +namespace ComputeSharp.Resources.Debug +{ + /// + /// A debug proxy used to display items in a instance. + /// + /// The type of items to display. + internal sealed class Texture2DDebugView + where T : unmanaged + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance with the items to display. + public Texture2DDebugView(Texture2D? texture) + { + if (texture is not null) + { + var items = new T[texture.Height, texture.Width]; + + texture.CopyTo(ref items[0, 0], items.Length, 0, 0, texture.Width, texture.Height); + + Items = items; + } + } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,]? Items { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Debug/Texture3DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/Texture3DDebugView{T}.cs new file mode 100644 index 00000000..4525bb9d --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Debug/Texture3DDebugView{T}.cs @@ -0,0 +1,34 @@ +using System.Diagnostics; + +namespace ComputeSharp.Resources.Debug +{ + /// + /// A debug proxy used to display items in a instance. + /// + /// The type of items to display. + internal sealed class Texture3DDebugView + where T : unmanaged + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance with the items to display. + public Texture3DDebugView(Texture3D? texture) + { + if (texture is not null) + { + var items = new T[texture.Depth, texture.Height, texture.Width]; + + texture.CopyTo(ref items[0, 0, 0], items.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth); + + Items = items; + } + } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,,]? Items { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs new file mode 100644 index 00000000..cdab1e29 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Debug/TransferBufferDebugView{T}.cs @@ -0,0 +1,35 @@ +using System; +using System.Diagnostics; + +namespace ComputeSharp.Resources.Debug +{ + /// + /// A debug proxy used to display items in a instance. + /// + /// The type of items to display. + internal sealed class TransferBufferDebugView + where T : unmanaged + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance with the items to display. + public TransferBufferDebugView(TransferBuffer? buffer) + { + if (buffer is not null) + { + var items = GC.AllocateUninitializedArray(buffer.Length); + + buffer.Span.CopyTo(items); + + Items = items; + } + } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[]? Items { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture2DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture2DDebugView{T}.cs new file mode 100644 index 00000000..a98ed5d5 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture2DDebugView{T}.cs @@ -0,0 +1,27 @@ +using System.Diagnostics; + +namespace ComputeSharp.Resources.Debug +{ + /// + /// A debug proxy used to display items in a instance. + /// + /// The type of items to display. + internal sealed class TransferTexture2DDebugView + where T : unmanaged + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance with the items to display. + public TransferTexture2DDebugView(TransferTexture2D? texture) + { + Items = texture?.View.ToArray(); + } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,]? Items { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture3DDebugView{T}.cs b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture3DDebugView{T}.cs new file mode 100644 index 00000000..213a0845 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Debug/TransferTexture3DDebugView{T}.cs @@ -0,0 +1,27 @@ +using System.Diagnostics; + +namespace ComputeSharp.Resources.Debug +{ + /// + /// A debug proxy used to display items in a instance. + /// + /// The type of items to display. + internal sealed class TransferTexture3DDebugView + where T : unmanaged + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance with the items to display. + public TransferTexture3DDebugView(TransferTexture3D? texture) + { + Items = texture?.View.ToArray(); + } + + /// + /// Gets the items to display for the current instance. + /// + [DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] + public T[,,]? Items { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Enums/AllocationMode.cs b/src/ComputeSharp/Graphics/Resources/Enums/AllocationMode.cs new file mode 100644 index 00000000..4f2e508b --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Enums/AllocationMode.cs @@ -0,0 +1,20 @@ +namespace ComputeSharp +{ + /// + /// An that indicates a mode to use when allocating resources. + /// + public enum AllocationMode + { + /// + /// The default allocation mode for graphics resources. Allocated buffers are not explicitly cleared when created. + /// They can still be cleared for security reasons in some situations, but this step will be skipped whenever possible. + /// As such, always make sure not to read directly to buffers created this way before writing data to them first. + /// + Default, + + /// + /// Clear allocated buffers when creating them. + /// + Clear + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Enums/ResourceType.cs b/src/ComputeSharp/Graphics/Resources/Enums/ResourceType.cs new file mode 100644 index 00000000..99505b8b --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Enums/ResourceType.cs @@ -0,0 +1,43 @@ +namespace ComputeSharp.Graphics.Resources.Enums +{ + /// + /// An that indicates the type of a given HLSL resource. + /// + internal enum ResourceType + { + /// + /// A constant resource, with items aligned to 16 bytes, used for individual values or very small arrays. + /// This is only supported for buffers and is mapped to a . + /// Resources of this type are located in . + /// + Constant, + + /// + /// A readonly resource, that can store arbitrary arrays of values and can only be read from by the GPU. + /// This is mapped to either or . + /// Resources of this type are located in . + /// + ReadOnly, + + /// + /// A read write resource, that can store arbitrary arrays with both read and write access for the GPU. + /// This is mapped to either or . + /// Resources of this type are located in . + /// + ReadWrite, + + /// + /// A readback resource, used temporarily to read data back from and resources. + /// This has no direct mapping to a type in HLSL, as it's only used for copy operations. + /// Resources of this type are located in . + /// + ReadBack, + + /// + /// A transfer resource, used temporarily to set data to and resources. + /// This has no direct mapping to a type in HLSL, as it's only used for copy operations (like ). + /// Resources of this type are located in . + /// + Upload + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs new file mode 100644 index 00000000..d0504e42 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture2D{TPixel}.cs @@ -0,0 +1,36 @@ +namespace ComputeSharp +{ + /// + /// An interface representing a typed readonly 2D texture containing normalized pixel data stored on GPU memory. + /// This interface can only be used to wrap instances. + /// + /// The type of normalized pixels used on the GPU side. + public interface IReadOnlyTexture2D + where TPixel : unmanaged + { + /// + /// Gets the width of the current texture. + /// + int Width { get; } + + /// + /// Gets the height of the current texture. + /// + int Height { get; } + + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[int x, int y] { get; } + + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[Int2 xy] { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs new file mode 100644 index 00000000..30f1db44 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadOnlyTexture3D{TPixel}.cs @@ -0,0 +1,42 @@ +namespace ComputeSharp +{ + /// + /// An interface representing a typed readonly 3D texture containing normalized pixel data stored on GPU memory. + /// This interface can only be used to wrap instances. + /// + /// The type of normalized pixels used on the GPU side. + public interface IReadOnlyTexture3D + where TPixel : unmanaged + { + /// + /// Gets the width of the current texture. + /// + int Width { get; } + + /// + /// Gets the height of the current texture. + /// + int Height { get; } + + /// + /// Gets the depth of the current texture. + /// + int Depth { get; } + + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[int x, int y, int z] { get; } + + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + TPixel this[Int3 xyz] { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs new file mode 100644 index 00000000..547c3683 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture2D{TPixel}.cs @@ -0,0 +1,36 @@ +namespace ComputeSharp +{ + /// + /// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory. + /// This interface can only be used to wrap instances. + /// + /// The type of normalized pixels used on the GPU side. + public interface IReadWriteTexture2D + where TPixel : unmanaged + { + /// + /// Gets the width of the current texture. + /// + int Width { get; } + + /// + /// Gets the height of the current texture. + /// + int Height { get; } + + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[int x, int y] { get; } + + /// + /// Gets or sets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[Int2 xy] { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs new file mode 100644 index 00000000..61536271 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Interfaces/IReadWriteTexture3D{TPixel}.cs @@ -0,0 +1,42 @@ +namespace ComputeSharp +{ + /// + /// An interface representing a typed writeable 2D texture containing normalized pixel data stored on GPU memory. + /// This interface can only be used to wrap instances. + /// + /// The type of normalized pixels used on the GPU side. + public interface IReadWriteTexture3D + where TPixel : unmanaged + { + /// + /// Gets the width of the current texture. + /// + int Width { get; } + + /// + /// Gets the height of the current texture. + /// + int Height { get; } + + /// + /// Gets the depth of the current texture. + /// + int Depth { get; } + + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[int x, int y, int z] { get; } + + /// + /// Gets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + ref TPixel this[Int3 xyz] { get; } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Interop/ID3D12ResourceMap.cs b/src/ComputeSharp/Graphics/Resources/Interop/ID3D12ResourceMap.cs new file mode 100644 index 00000000..d6cb938b --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Interop/ID3D12ResourceMap.cs @@ -0,0 +1,43 @@ +using System; +using System.Runtime.CompilerServices; +using ComputeSharp.Graphics.Extensions; +using TerraFX.Interop; + +namespace ComputeSharp.Graphics.Resources.Interop +{ + /// + /// A type representing a mapped memory resource. + /// + internal readonly unsafe ref struct ID3D12ResourceMap + { + /// + /// The target to map. + /// + private readonly ID3D12Resource* d3D12Resource; + + /// + /// The pointer to the mapped resource. + /// + public readonly void* Pointer; + + /// + /// Creates a new instance for a given value. + /// + /// The input instance to map. + /// The pointer to the mapped resource. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ID3D12ResourceMap(ID3D12Resource* d3D12Resource, void* pointer) + { + this.d3D12Resource = d3D12Resource; + + Pointer = pointer; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Dispose() + { + this.d3D12Resource->Unmap(); + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadBackBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadBackBuffer{T}.cs new file mode 100644 index 00000000..9670e6c6 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadBackBuffer{T}.cs @@ -0,0 +1,34 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed buffer stored on CPU memory, that can be used to transfer back from the GPU. + /// + /// The type of items stored on the buffer. + [DebuggerTypeProxy(typeof(TransferBufferDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadBackBuffer : TransferBuffer + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ReadBackBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.ReadBack, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.ReadBackBuffer<{typeof(T)}>[{Length}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadBackTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadBackTexture2D{T}.cs new file mode 100644 index 00000000..211c7f36 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadBackTexture2D{T}.cs @@ -0,0 +1,35 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed 2D texture stored on CPU memory, that can be used to transfer back from the GPU. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(TransferTexture2DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadBackTexture2D : TransferTexture2D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadBackTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadBack, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.ReadBackTexture2D<{typeof(T)}>[{Width}, {Height}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadBackTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadBackTexture3D{T}.cs new file mode 100644 index 00000000..aeb4a130 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadBackTexture3D{T}.cs @@ -0,0 +1,36 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed 3D texture stored on CPU memory, that can be used to transfer back from the GPU. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadBackTexture3D : TransferTexture3D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadBackTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadBack, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.ReadBackTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyBuffer{T}.cs new file mode 100644 index 00000000..a47dfe23 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyBuffer{T}.cs @@ -0,0 +1,42 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed readonly buffer stored on GPU memory. + /// + /// The type of items stored on the buffer. + [DebuggerTypeProxy(typeof(BufferDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadOnlyBuffer : StructuredBuffer + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ReadOnlyBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.ReadOnly, allocationMode) + { + } + + /// + /// Gets a single value from the current readonly buffer. + /// + /// The index of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int i] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyBuffer)}[int]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyBuffer<{typeof(T)}>[{Length}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T,TPixel}.cs new file mode 100644 index 00000000..44f538df --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T,TPixel}.cs @@ -0,0 +1,48 @@ +using System.Diagnostics; +using ComputeSharp.__Internals; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// A representing a typed readonly 2D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + /// The type of pixels used on the GPU side. + [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadOnlyTexture2D : Texture2D, IReadOnlyTexture2D + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D) + { + } + + /// + public TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture2D)}[int,int]"); + + /// + public TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture2D)}[Int2]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture2D<{typeof(T)},{typeof(TPixel)}>[{Width}, {Height}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T}.cs new file mode 100644 index 00000000..41f3f9db --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture2D{T}.cs @@ -0,0 +1,52 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +namespace ComputeSharp +{ + /// + /// A representing a typed readonly 2D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadOnlyTexture2D : Texture2D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D) + { + } + + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int x, int y] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture2D)}[int,int]"); + + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[Int2 xy] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture2D)}[Int2]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture2D<{typeof(T)}>[{Width}, {Height}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T,TPixel}.cs new file mode 100644 index 00000000..338aa596 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T,TPixel}.cs @@ -0,0 +1,49 @@ +using System.Diagnostics; +using ComputeSharp.__Internals; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// A representing a typed readonly 3D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + /// The type of pixels used on the GPU side. + [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadOnlyTexture3D : Texture3D, IReadOnlyTexture3D + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D) + { + } + + /// + public TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture3D)}[int,int,int]"); + + /// + public TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture3D)}[Int3]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture3D<{typeof(T)},{nameof(TPixel)}>[{Width}, {Height}, {Depth}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T}.cs new file mode 100644 index 00000000..1499f82b --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadOnlyTexture3D{T}.cs @@ -0,0 +1,54 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +namespace ComputeSharp +{ + /// + /// A representing a typed readonly 3D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadOnlyTexture3D : Texture3D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadOnlyTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadOnly, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D) + { + } + + /// + /// Gets a single value from the current readonly texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[int x, int y, int z] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture3D)}[int,int,int]"); + + /// + /// Gets a single value from the current readonly texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public T this[Int3 xyz] => throw new InvalidExecutionContextException($"{nameof(ReadOnlyTexture3D)}[Int3]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadOnlyTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteBuffer{T}.cs new file mode 100644 index 00000000..3dc0763c --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteBuffer{T}.cs @@ -0,0 +1,42 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed read write buffer stored on GPU memory. + /// + /// The type of items stored on the buffer. + [DebuggerTypeProxy(typeof(BufferDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadWriteBuffer : StructuredBuffer + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal ReadWriteBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.ReadWrite, allocationMode) + { + } + + /// + /// Gets or sets a single value from the current writeable buffer. + /// + /// The index of the value to get or set. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[int i] => throw new InvalidExecutionContextException($"{nameof(ReadWriteBuffer)}[int]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteBuffer<{typeof(T)}>[{Length}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T,TPixel}.cs new file mode 100644 index 00000000..a3f58a0e --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T,TPixel}.cs @@ -0,0 +1,48 @@ +using System.Diagnostics; +using ComputeSharp.__Internals; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// A representing a typed read write 2D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + /// The type of pixels used on the GPU side. + [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadWriteTexture2D : Texture2D, IReadWriteTexture2D + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) + { + } + + /// + public ref TPixel this[int x, int y] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture2D)}[int,int]"); + + /// + public ref TPixel this[Int2 xy] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture2D)}[Int2]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture2D<{typeof(T)},{typeof(TPixel)}>[{Width}, {Height}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T}.cs new file mode 100644 index 00000000..4f09e124 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture2D{T}.cs @@ -0,0 +1,52 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +namespace ComputeSharp +{ + /// + /// A representing a typed read write 2D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(Texture2DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadWriteTexture2D : Texture2D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE2D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) + { + } + + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[int x, int y] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture2D)}[int,int]"); + + /// + /// Gets or sets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[Int2 xy] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture2D)}[Int2]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture2D<{typeof(T)}>[{Width}, {Height}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T,TPixel}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T,TPixel}.cs new file mode 100644 index 00000000..f5436dcb --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T,TPixel}.cs @@ -0,0 +1,49 @@ +using System.Diagnostics; +using ComputeSharp.__Internals; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +#pragma warning disable CS0618 + +namespace ComputeSharp +{ + /// + /// A representing a typed readonly 3D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + /// The type of pixels used on the GPU side. + [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadWriteTexture3D : Texture3D, IReadWriteTexture3D + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) + { + } + + /// + public ref TPixel this[int x, int y, int z] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture3D)}[int,int,int]"); + + /// + public ref TPixel this[Int3 xyz] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture3D)}[Int3]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture3D<{typeof(T)},{nameof(TPixel)}>[{Width}, {Height}, {Depth}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T}.cs new file mode 100644 index 00000000..51c2dc54 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/ReadWriteTexture3D{T}.cs @@ -0,0 +1,54 @@ +using System.Diagnostics; +using ComputeSharp.Exceptions; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; +using static TerraFX.Interop.D3D12_FORMAT_SUPPORT1; + +namespace ComputeSharp +{ + /// + /// A representing a typed readonly 3D texture stored on GPU memory. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(Texture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadWriteTexture3D : Texture3D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadWriteTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadWrite, allocationMode, D3D12_FORMAT_SUPPORT1_TEXTURE3D | D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW) + { + } + + /// + /// Gets a single value from the current writeable texture. + /// + /// The horizontal offset of the value to get. + /// The vertical offset of the value to get. + /// The depthwise offset of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[int x, int y, int z] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture3D)}[int,int,int]"); + + /// + /// Gets a single value from the current writeable texture. + /// + /// The coordinates of the value to get. + /// This API can only be used from a compute shader, and will always throw if used anywhere else. + public ref T this[Int3 xyz] => throw new InvalidExecutionContextException($"{nameof(ReadWriteTexture3D)}[Int3]"); + + /// + public override string ToString() + { + return $"ComputeSharp.ReadWriteTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/UploadBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/UploadBuffer{T}.cs new file mode 100644 index 00000000..d615a1db --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/UploadBuffer{T}.cs @@ -0,0 +1,34 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed buffer stored on CPU memory, that can be used to transfer data to the GPU. + /// + /// The type of items stored on the buffer. + [DebuggerTypeProxy(typeof(TransferBufferDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class UploadBuffer : TransferBuffer + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The number of items to store in the current buffer. + /// The allocation mode to use for the new resource. + internal UploadBuffer(GraphicsDevice device, int length, AllocationMode allocationMode) + : base(device, length, ResourceType.Upload, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.UploadBuffer<{typeof(T)}>[{Length}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/UploadTexture2D{T}.cs b/src/ComputeSharp/Graphics/Resources/UploadTexture2D{T}.cs new file mode 100644 index 00000000..1aa426d4 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/UploadTexture2D{T}.cs @@ -0,0 +1,35 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed 2D texture stored on CPU memory, that can be used to transfer data to the GPU. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(TransferTexture2DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class UploadTexture2D : TransferTexture2D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The allocation mode to use for the new resource. + internal UploadTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) + : base(device, width, height, ResourceType.Upload, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.UploadTexture2D<{typeof(T)}>[{Width}, {Height}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/UploadTexture3D{T}.cs b/src/ComputeSharp/Graphics/Resources/UploadTexture3D{T}.cs new file mode 100644 index 00000000..eacc0862 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/UploadTexture3D{T}.cs @@ -0,0 +1,36 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed 3D texture stored on CPU memory, that can be used to transfer data to the GPU. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class UploadTexture3D : TransferTexture3D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal UploadTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.Upload, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.UploadTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs new file mode 100644 index 00000000..6bea689f --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs @@ -0,0 +1,399 @@ +using System; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using ComputeSharp.Resources.Views; + +#pragma warning disable CS0809 + +namespace ComputeSharp +{ + /// + /// The type represents a view over a 2D texture allocated on host memory, providing APIs to + /// easily manipulate its contents without having to manually deal with the internal alignment requirements of textures. + /// As such, one key difference with and arrays is that the underlying buffer for a + /// instance might not be contiguous in memory. All this logic is handled internally by the + /// type and it is transparent to the user, but note that working over discontiguous buffers has a performance impact. + /// It is recommended to execute as much computation on the GPU side as possible. + /// + /// The type of items in the current instance. + public readonly unsafe ref partial struct TextureView2D + where T : unmanaged + { + // Let's consider a representation of a 2D texture or a generic 2D memory region. + // The data is represented in row-major order as usual, and the 'XX' grid cells + // represent locations that are mapped by a given TextureView2D instance. + // An important aspec to note is that the pitch of each row is calculated in + // bytes, as the texture layout alignment is unrelated to the logical type in use. + // Assuming we a stride that's greater than the logical rows, we might have: + // + // pointer__ _________width_________ + // \/ \ + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | |-height + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // \________________stride_________________________/ + + /// + /// The pointer to the first element of the target 2D region. + /// + private readonly T* pointer; + + /// + /// The width of the specified 2D texture. + /// + private readonly int width; + + /// + /// The height of the specified 2D region. + /// + private readonly int height; + + /// + /// The row pitch of the specified 2D region. + /// + private readonly int pitchInBytes; + + /// + /// Initializes a new instance of the struct with the specified parameters. + /// + /// The pointer to the start of the memory area to map. + /// The width of the 2D memory area to map. + /// The height of the 2D memory area to map. + /// The row pitch in bytes of the 2D memory area to map. + internal TextureView2D(T* pointer, int width, int height, int pitchInBytes) + { + this.pointer = pointer; + this.width = width; + this.height = height; + this.pitchInBytes = pitchInBytes; + } + + /// + /// Gets an empty instance. + /// + public static TextureView2D Empty => default; + + /// + /// Gets a value indicating whether the current instance is empty. + /// + public bool IsEmpty + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width == 0; + } + + /// + /// Gets the total length of the current instance. + /// + public int Length + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width * this.height; + } + + /// + /// Gets the width of the underlying 2D memory area. + /// + public int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width; + } + + /// + /// Gets the height of the underlying 2D memory area. + /// + public int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.height; + } + + /// + /// Gets the element at the specified zero-based indices. + /// + /// The target column to get the element from. + /// The target row to get the element from. + /// A reference to the element at the specified indices. + /// + /// Thrown when either or are invalid. + /// + public ref T this[int x, int y] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + if ((uint)x >= (uint)this.width || + (uint)y >= (uint)this.height) + { + ThrowHelper.ThrowIndexOutOfRangeException(); + } + + return ref *((T*)((byte*)this.pointer + (y * this.pitchInBytes)) + x); + } + } + + /// + /// Clears the contents of the current instance. + /// + public void Clear() + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Clear(); + } + else + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y).Clear(); + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(Span destination) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.CopyTo(destination); + } + else + { + if (Length > destination.Length) + { + ThrowHelper.ThrowArgumentExceptionForDestinationTooShort(); + } + + for (int y = 0, j = 0; y < this.height; y++, j += this.width) + { + GetRowSpan(y).CopyTo(destination.Slice(j)); + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// For this API to succeed, the target has to have the same shape as the current one. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(TextureView2D destination) + { + if (destination.width != this.width || + destination.width != this.height) + { + ThrowHelper.ThrowArgumentException(); + } + + if (IsEmpty) + { + return; + } + + if (destination.TryGetSpan(out Span span)) + { + CopyTo(span); + } + else + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y).CopyTo(destination.GetRowSpan(y)); + } + } + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(Span destination) + { + if (destination.Length >= Length) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(TextureView2D destination) + { + if (destination.width == this.width || + destination.height == this.height) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Fills the elements of this span with a specified value. + /// + /// The value to assign to each element of the instance. + public void Fill(T value) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Fill(value); + } + else + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y).Fill(value); + } + } + } + + /// + /// Returns a reference to the first element within the current instance, with no bounds check. + /// + /// A reference to the first element within the current instance. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public T* DangerousGetAddressAndByteStride(out int strideInBytes) + { + strideInBytes = this.pitchInBytes; + + return this.pointer; + } + + /// + /// Gets a for a specified row. + /// + /// The index of the target row to retrieve. + /// Throw when is out of range. + /// The resulting row . + [Pure] + public Span GetRowSpan(int y) + { + if ((uint)y >= (uint)this.height) + { + ThrowHelper.ThrowArgumentOutOfRangeExceptionForRow(); + } + + return new((byte*)this.pointer + (y * this.pitchInBytes), this.width); + } + + /// + /// Tries to get a instance, if the underlying buffer is contiguous and small enough. + /// + /// The resulting , in case of success. + /// Whether or not was correctly assigned. + public bool TryGetSpan(out Span span) + { + if (this.pitchInBytes == this.width) + { + span = new(this.pointer, Length); + + return true; + } + + span = default; + + return false; + } + + /// + /// Copies the contents of the current instance into a new 2D array. + /// + /// A 2D array containing the data in the current instance. + [Pure] + public T[,] ToArray() + { + T[,] array = new T[this.height, this.width]; + + fixed (T* pointer = array) + { + CopyTo(new Span(pointer, Length)); + } + + return array; + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] + public override bool Equals(object? obj) + { + throw new NotSupportedException("ComputeSharp.TextureView2D.Equals(object) is not supported"); + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("GetHashCode() on Span will always throw an exception.")] + public override int GetHashCode() + { + throw new NotSupportedException("ComputeSharp.TextureView2D.GetHashCode() is not supported"); + } + + /// + public override string ToString() + { + return $"ComputeSharp.TextureView2D<{typeof(T)}>[{Width}, {Height}]"; + } + + /// + /// Checks whether two instances are equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are equal. + public static bool operator ==(TextureView2D left, TextureView2D right) + { + return left.pointer == right.pointer; + } + + /// + /// Checks whether two instances are not equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are not equal. + public static bool operator !=(TextureView2D left, TextureView2D right) + { + return !(left == right); + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs new file mode 100644 index 00000000..f203cde8 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs @@ -0,0 +1,440 @@ +using System; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using ComputeSharp.Resources.Views; + +#pragma warning disable CS0809 + +namespace ComputeSharp +{ + /// + /// The mirrors the type but representing a memory + /// area spanning 3 dimensions. The underlying buffer can be discontiguous across both the height and the depth. + /// It is recommended to execute as much computation on the GPU side as possible. + /// + /// The type of items in the current instance. + public readonly unsafe ref partial struct TextureView3D + where T : unmanaged + { + // The internal layout of a 3D texture mapped in memory is the same as that of a + // 3D texture, with different 3D slices being stacked along the depth axis. Each + // slice also has the same padding as the one between rows, which means that if + // rows have no padding, all 3D slices are contiguous in memory as well. + // The memory representation essentially looks like this: + // + // ________________width______________ + // / __pointer \ + // / / \ + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | |-height + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- |-| + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // ` ` ` ` ` ` ` ` ` ` ` + // ` ` ` ` ` ` ` ` ` ` ` + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // | XX | XX | XX | XX | XX | XX | XX | XX | -- | -- | + // \________________stride_________________________/ + // + // Note that the depth stride is omitted after the last 3D slice. + + /// + /// The pointer to the first element of the target 3D region. + /// + private readonly T* pointer; + + /// + /// The width of the specified 3D texture. + /// + private readonly int width; + + /// + /// The height of the specified 3D region. + /// + private readonly int height; + + /// + /// The depth of the specified 3D region. + /// + private readonly int depth; + + /// + /// The stride of the specified 3D region. + /// + private readonly int strideInBytes; + + /// + /// Initializes a new instance of the struct with the specified parameters. + /// + /// The pointer to the start of the memory area to map. + /// The width of the 3D memory area to map. + /// The height of the 3D memory area to map. + /// The depth of the 3D memory area to map. + /// The stride in bytes of the 3D memory area to map. + internal TextureView3D(T* pointer, int width, int height, int depth, int strideInBytes) + { + this.pointer = pointer; + this.width = width; + this.height = height; + this.depth = depth; + this.strideInBytes = strideInBytes; + } + + /// + /// Gets an empty instance. + /// + public static TextureView3D Empty => default; + + /// + /// Gets a value indicating whether the current instance is empty. + /// + public bool IsEmpty + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width == 0; + } + + /// + /// Gets the total length of the current instance. + /// + public int Length + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width * this.height * this.depth; + } + + /// + /// Gets the width of the underlying 3D memory area. + /// + public int Width + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.width; + } + + /// + /// Gets the height of the underlying 3D memory area. + /// + public int Height + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.height; + } + + /// + /// Gets the depth of the underlying 3D memory area. + /// + public int Depth + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.depth; + } + + /// + /// Gets the element at the specified zero-based indices. + /// + /// The target column to get the element from. + /// The target row to get the element from. + /// The target depth to get the element from. + /// A reference to the element at the specified indices. + /// + /// Thrown when either , or are invalid. + /// + public ref T this[int x, int y, int z] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + if ((uint)x >= (uint)this.width || + (uint)y >= (uint)this.height || + (uint)z >= (uint)this.depth) + { + ThrowHelper.ThrowIndexOutOfRangeException(); + } + + return ref *((T*)((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes)) + x); + } + } + + /// + /// Clears the contents of the current instance. + /// + public void Clear() + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Clear(); + } + else + { + for (int z = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y, z).Clear(); + } + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(Span destination) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.CopyTo(destination); + } + else + { + for (int z = 0, j = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++, j += this.width) + { + GetRowSpan(y, z).CopyTo(destination.Slice(j)); + } + } + } + } + + /// + /// Copies the contents of this into a destination instance. + /// For this API to succeed, the target has to have the same shape as the current one. + /// + /// The destination instance. + /// + /// Thrown when is shorter than the source instance. + /// + public void CopyTo(TextureView3D destination) + { + if (destination.width != this.width || + destination.width != this.height) + { + ThrowHelper.ThrowArgumentException(); + } + + if (IsEmpty) + { + return; + } + + if (destination.TryGetSpan(out Span span)) + { + CopyTo(span); + } + else + { + for (int z = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y, z).CopyTo(destination.GetRowSpan(y, z)); + } + } + } + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(Span destination) + { + if (destination.Length >= Length) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Attempts to copy the current instance to a destination . + /// + /// The target of the copy operation. + /// Whether or not the operation was successful. + public bool TryCopyTo(TextureView3D destination) + { + if (destination.width == this.width || + destination.height == this.height) + { + CopyTo(destination); + + return true; + } + + return false; + } + + /// + /// Fills the elements of this span with a specified value. + /// + /// The value to assign to each element of the instance. + public void Fill(T value) + { + if (IsEmpty) + { + return; + } + + if (TryGetSpan(out Span span)) + { + span.Fill(value); + } + else + { + for (int z = 0; z < this.depth; z++) + { + for (int y = 0; y < this.height; y++) + { + GetRowSpan(y, z).Fill(value); + } + } + } + } + + /// + /// Returns a reference to the first element within the current instance, with no bounds check. + /// + /// A reference to the first element within the current instance. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public T* DangerousGetAddressAndByteStride(out int strideInBytes) + { + strideInBytes = this.strideInBytes; + + return this.pointer; + } + + /// + /// Gets a for a specified row. + /// + /// The index of the target row to retrieve. + /// The depth of the row to retrieve. + /// + /// Throw when either or are out of range. + /// + /// The resulting row . + [Pure] + public Span GetRowSpan(int y, int z) + { + if ((uint)y >= (uint)this.height) + { + ThrowHelper.ThrowArgumentOutOfRangeExceptionForRow(); + } + + if ((uint)z >= (uint)this.depth) + { + ThrowHelper.ThrowArgumentOutOfRangeExceptionForZ(); + } + + return new((byte*)this.pointer + (z * this.height * this.strideInBytes) + (y * this.strideInBytes), this.width); + } + + /// + /// Tries to get a instance, if the underlying buffer is contiguous and small enough. + /// + /// The resulting , in case of success. + /// Whether or not was correctly assigned. + public bool TryGetSpan(out Span span) + { + if (this.strideInBytes == this.width) + { + span = new(this.pointer, Length); + + return true; + } + + span = default; + + return false; + } + + /// + /// Copies the contents of the current instance into a new 3D array. + /// + /// A 3D array containing the data in the current instance. + [Pure] + public T[,,] ToArray() + { + T[,,] array = new T[this.depth, this.height, this.width]; + + fixed (T* pointer = array) + { + CopyTo(new Span(pointer, Length)); + } + + return array; + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] + public override bool Equals(object? obj) + { + throw new NotSupportedException("ComputeSharp.TextureView3D.Equals(object) is not supported"); + } + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("GetHashCode() on Span will always throw an exception.")] + public override int GetHashCode() + { + throw new NotSupportedException("ComputeSharp.TextureView3D.GetHashCode() is not supported"); + } + + /// + public override string ToString() + { + return $"ComputeSharp.TextureView3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + + /// + /// Checks whether two instances are equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are equal. + public static bool operator ==(TextureView3D left, TextureView3D right) + { + return left.pointer == right.pointer; + } + + /// + /// Checks whether two instances are not equal. + /// + /// The first instance to compare. + /// The second instance to compare. + /// Whether or not and are not equal. + public static bool operator !=(TextureView3D left, TextureView3D right) + { + return !(left == right); + } + } +} diff --git a/src/ComputeSharp/Graphics/Resources/Views/ThrowHelper.cs b/src/ComputeSharp/Graphics/Resources/Views/ThrowHelper.cs new file mode 100644 index 00000000..9c7d9a94 --- /dev/null +++ b/src/ComputeSharp/Graphics/Resources/Views/ThrowHelper.cs @@ -0,0 +1,78 @@ +using System; + +namespace ComputeSharp.Resources.Views +{ + /// + /// A helper class to throw exceptions for view types. + /// + internal static class ThrowHelper + { + /// + /// Throws an when the target span is too short. + /// + public static void ThrowArgumentExceptionForDestinationTooShort() + { + throw new ArgumentException("The target span is too short to copy all the current items to"); + } + + /// + /// Throws an when the a given coordinate is invalid. + /// + /// + /// Throwing is technically discouraged in the docs, but + /// we're doing that here for consistency with the official type(s) from the BCL. + /// + public static void ThrowIndexOutOfRangeException() + { + throw new IndexOutOfRangeException(); + } + + /// + /// Throws an when more than one parameter are invalid. + /// + public static void ThrowArgumentException() + { + throw new ArgumentException("One or more input parameters were invalid"); + } + + /// + /// Throws an when the "row" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForRow() + { + throw new ArgumentOutOfRangeException("row"); + } + + /// + /// Throws an when the "column" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForColumn() + { + throw new ArgumentOutOfRangeException("column"); + } + + /// + /// Throws an when the "z" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForZ() + { + throw new ArgumentOutOfRangeException("z"); + } + + /// + /// Throws an when the "height" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForHeight() + { + throw new ArgumentOutOfRangeException("height"); + } + + /// + /// Throws an when the "width" parameter is invalid. + /// + public static void ThrowArgumentOutOfRangeExceptionForWidth() + { + throw new ArgumentOutOfRangeException("width"); + } + } +} diff --git a/src/ComputeSharp/Libraries/dxcompiler.dll b/src/ComputeSharp/Libraries/dxcompiler.dll new file mode 100644 index 00000000..58a39df1 Binary files /dev/null and b/src/ComputeSharp/Libraries/dxcompiler.dll differ diff --git a/src/ComputeSharp/Libraries/dxil.dll b/src/ComputeSharp/Libraries/dxil.dll new file mode 100644 index 00000000..598d4aee Binary files /dev/null and b/src/ComputeSharp/Libraries/dxil.dll differ diff --git a/src/ComputeSharp.Shaders/Properties/AssemblyInfo.cs b/src/ComputeSharp/Properties/AssemblyInfo.cs similarity index 69% rename from src/ComputeSharp.Shaders/Properties/AssemblyInfo.cs rename to src/ComputeSharp/Properties/AssemblyInfo.cs index 1b03d252..0d511608 100644 --- a/src/ComputeSharp.Shaders/Properties/AssemblyInfo.cs +++ b/src/ComputeSharp/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("ComputeSharp")] +[module: SkipLocalsInit] + [assembly: InternalsVisibleTo("ComputeSharp.Tests.Internals")] diff --git a/src/ComputeSharp/Shaders/Exceptions/HlslCompilationException.cs b/src/ComputeSharp/Shaders/Exceptions/HlslCompilationException.cs new file mode 100644 index 00000000..8f312679 --- /dev/null +++ b/src/ComputeSharp/Shaders/Exceptions/HlslCompilationException.cs @@ -0,0 +1,41 @@ +using System; +using System.Diagnostics.Contracts; +using System.Text; + +namespace ComputeSharp.Exceptions +{ + /// + /// A custom type that indicates when a shader compilation with the DXC compiler has failed. + /// + public sealed class HlslCompilationException : Exception + { + /// + /// Creates a new instance. + /// + /// The error message produced by the DXC compiler. + internal HlslCompilationException(string error) + : base(GetExceptionMessage(error)) + { + } + + /// + /// Gets a formatted exception message for a given compilation error. + /// + /// The input compilatin error message from the DXC compiler. + /// A formatted error message for a new instance. + [Pure] + private static string GetExceptionMessage(string error) + { + StringBuilder builder = new(512); + + builder.AppendLine("The DXC compiler encountered one or more errors while trying to compile the shader:"); + builder.AppendLine(); + builder.AppendLine(error.Trim()); + builder.AppendLine(); + builder.AppendLine("Make sure to only be using supported features by checking the README file in the ComputeSharp repository: https://github.com/Sergio0694/ComputeSharp."); + builder.Append("If you're sure that your C# shader code is valid, please open an issue an include a working repro and this error message."); + + return builder.ToString(); + } + } +} diff --git a/src/ComputeSharp/Shaders/Extensions/ID3D12DeviceExtensions.cs b/src/ComputeSharp/Shaders/Extensions/ID3D12DeviceExtensions.cs new file mode 100644 index 00000000..fe254f94 --- /dev/null +++ b/src/ComputeSharp/Shaders/Extensions/ID3D12DeviceExtensions.cs @@ -0,0 +1,99 @@ +using System; +using ComputeSharp.Core.Extensions; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_PIPELINE_STATE_FLAGS; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp.Shaders.Extensions +{ + /// + /// A with extensions for the type. + /// + internal static unsafe class ID3D12DeviceExtensions + { + /// + /// Creates a new for a given device. + /// + /// The target to use to create the root signature. + /// The number of 32 bit root constants to load. + /// The input descriptor ranges for the signature to create. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the root signature fails. + public static ComPtr CreateRootSignature( + this ref ID3D12Device d3D12Device, + int d3D12Root32BitConstantsCount, + ReadOnlySpan d3D12DescriptorRanges1) + { + using ComPtr d3D3Blob = default; + using ComPtr d3D3BlobError = default; + using ComPtr d3D12RootSignature = default; + + fixed (D3D12_DESCRIPTOR_RANGE1* d3D12DescriptorRange1 = d3D12DescriptorRanges1) + { + D3D12_ROOT_PARAMETER1* d3D12RootParameters1 = stackalloc D3D12_ROOT_PARAMETER1[d3D12DescriptorRanges1.Length + 1]; + + // The initial constant buffer is initialized with 32 bit root constants. + // This avoids having to manage an extra buffer for each shader dispatch. + D3D12_ROOT_PARAMETER1.InitAsConstants(out *d3D12RootParameters1, (uint)d3D12Root32BitConstantsCount, 0); + + // Pack each descriptor range into a root parameter with that single range as content + for (int i = 0; i < d3D12DescriptorRanges1.Length; i++) + { + D3D12_ROOT_PARAMETER1.InitAsDescriptorTable(out d3D12RootParameters1[i + 1], 1, d3D12DescriptorRange1 + i); + } + + // Root signature description wrapping the packed collection of root parameters + D3D12_VERSIONED_ROOT_SIGNATURE_DESC.Init_1_1( + out D3D12_VERSIONED_ROOT_SIGNATURE_DESC d3D12VersionedRootSignatureDescription, + (uint)d3D12DescriptorRanges1.Length + 1, + d3D12RootParameters1); + + // Serialize the root signature from the data just computed. When this is done + // we just work with the resulting blobs, so the input data can be unpinned. + FX.D3D12SerializeVersionedRootSignature( + &d3D12VersionedRootSignatureDescription, + d3D3Blob.GetAddressOf(), + d3D3BlobError.GetAddressOf()).Assert(); + } + + d3D12Device.CreateRootSignature( + 0, + d3D3Blob.Get()->GetBufferPointer(), + d3D3Blob.Get()->GetBufferSize(), + FX.__uuidof(), + d3D12RootSignature.GetVoidAddressOf()).Assert(); + + return d3D12RootSignature.Move(); + } + + /// + /// Creates a new for a given device. + /// + /// The target to use to create the pipeline state. + /// The input root signature to use to create the pipeline state. + /// The shader bytecode to use for the pipeline state. + /// A pointer to the newly allocated instance. + /// Thrown when the creation of the pipeline state fails. + public static ComPtr CreateComputePipelineState( + this ref ID3D12Device d3D12Device, + ID3D12RootSignature* d3D12RootSignature, + D3D12_SHADER_BYTECODE d3D12ShaderBytecode) + { + using ComPtr d3D12PipelineState = default; + + D3D12_COMPUTE_PIPELINE_STATE_DESC d3D12ComputePipelineStateDescription; + d3D12ComputePipelineStateDescription.pRootSignature = d3D12RootSignature; + d3D12ComputePipelineStateDescription.CS = d3D12ShaderBytecode; + d3D12ComputePipelineStateDescription.NodeMask = 0; + d3D12ComputePipelineStateDescription.CachedPSO = default; + d3D12ComputePipelineStateDescription.Flags = D3D12_PIPELINE_STATE_FLAG_NONE; + + d3D12Device.CreateComputePipelineState( + &d3D12ComputePipelineStateDescription, + FX.__uuidof(), + d3D12PipelineState.GetVoidAddressOf()).Assert(); + + return d3D12PipelineState.Move(); + } + } +} diff --git a/src/ComputeSharp/Shaders/Interop/ReflectionServices.cs b/src/ComputeSharp/Shaders/Interop/ReflectionServices.cs new file mode 100644 index 00000000..c0a04789 --- /dev/null +++ b/src/ComputeSharp/Shaders/Interop/ReflectionServices.cs @@ -0,0 +1,103 @@ +using System; +using System.Runtime.CompilerServices; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Shaders.Renderer; +using ComputeSharp.Shaders.Translation; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp.Interop +{ + /// + /// Provides methods to extract reflection info on compute shaders generated using this library. + /// + public static class ReflectionServices + { + /// + /// Gets the shader info associated with a given shader. + /// + /// This overload can be used for simplicity when the shader being inspected does not rely on captured + /// objects to be processed correctly. This is the case when it does not contain any -s. + /// + /// + /// The type of shader to retrieve info for. + /// The resulting instance. + /// + /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to + /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of + /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. + /// + public static void GetShaderInfo(out ShaderInfo shaderInfo) + where T : struct, IComputeShader + { + GetShaderInfo(default(T), out shaderInfo); + } + + /// + /// Gets the shader info associated with a given shader. + /// + /// The type of shader to retrieve info for. + /// The input shader to retrieve info for. + /// The resulting instance. + /// + /// The thread group sizes will always be set to (1, 1, 1) in the returned shader. This is done to + /// avoid having to compiler multiple shaders just to get reflection info for them. When using any of + /// the APIs to dispatch a shader, the thread sizes would actually be set to a proper value insead. + /// + public static unsafe void GetShaderInfo(in T shader, out ShaderInfo shaderInfo) + where T : struct, IComputeShader + { + ShaderLoader shaderLoader = ShaderLoader.Load(in shader); + + using var shaderSource = HlslShaderRenderer.Render(1, 1, 1, shaderLoader); + + using ComPtr dxcBlobBytecode = ShaderCompiler.Instance.CompileShader(shaderSource.WrittenSpan); + + using ComPtr dxcUtils = default; + Guid dxcLibraryClsid = FX.CLSID_DxcLibrary; + + FX.DxcCreateInstance(&dxcLibraryClsid, FX.__uuidof(), dxcUtils.GetVoidAddressOf()).Assert(); + + using ComPtr d3D12ShaderReflection = default; + + DxcBuffer dxcBuffer = default; + dxcBuffer.Ptr = dxcBlobBytecode.Get()->GetBufferPointer(); + dxcBuffer.Size = dxcBlobBytecode.Get()->GetBufferSize(); + + dxcUtils.Get()->CreateReflection( + &dxcBuffer, + FX.__uuidof(), + d3D12ShaderReflection.GetVoidAddressOf()).Assert(); + + D3D12_SHADER_DESC d3D12ShaderDescription; + + d3D12ShaderReflection.Get()->GetDesc(&d3D12ShaderDescription).Assert(); + + shaderInfo = default; + Unsafe.AsRef(shaderInfo.CompilerVersion) = new string(d3D12ShaderDescription.Creator); + Unsafe.AsRef(shaderInfo.HlslSource) = shaderSource.WrittenSpan.ToString(); + Unsafe.AsRef(shaderInfo.ConstantBufferCount) = d3D12ShaderDescription.ConstantBuffers; + Unsafe.AsRef(shaderInfo.BoundResourceCount) = d3D12ShaderDescription.BoundResources; + Unsafe.AsRef(shaderInfo.InstructionCount) = d3D12ShaderDescription.InstructionCount; + Unsafe.AsRef(shaderInfo.TemporaryRegisterCount) = d3D12ShaderDescription.TempRegisterCount; + Unsafe.AsRef(shaderInfo.TemporaryArrayCount) = d3D12ShaderDescription.TempArrayCount; + Unsafe.AsRef(shaderInfo.ConstantDefineCount) = d3D12ShaderDescription.DefCount; + Unsafe.AsRef(shaderInfo.DeclarationCount) = d3D12ShaderDescription.DclCount; + Unsafe.AsRef(shaderInfo.TextureNormalInstructions) = d3D12ShaderDescription.TextureNormalInstructions; + Unsafe.AsRef(shaderInfo.TextureLoadInstructionCount) = d3D12ShaderDescription.TextureLoadInstructions; + Unsafe.AsRef(shaderInfo.TextureStoreInstructionCount) = d3D12ShaderDescription.cTextureStoreInstructions; + Unsafe.AsRef(shaderInfo.FloatInstructionCount) = d3D12ShaderDescription.FloatInstructionCount; + Unsafe.AsRef(shaderInfo.IntInstructionCount) = d3D12ShaderDescription.IntInstructionCount; + Unsafe.AsRef(shaderInfo.UIntInstructionCount) = d3D12ShaderDescription.UintInstructionCount; + Unsafe.AsRef(shaderInfo.StaticFlowControlInstructionCount) = d3D12ShaderDescription.StaticFlowControlCount; + Unsafe.AsRef(shaderInfo.DynamicFlowControlInstructionCount) = d3D12ShaderDescription.DynamicFlowControlCount; + Unsafe.AsRef(shaderInfo.EmitInstructionCount) = d3D12ShaderDescription.EmitInstructionCount; + Unsafe.AsRef(shaderInfo.BarrierInstructionCount) = d3D12ShaderDescription.cBarrierInstructions; + Unsafe.AsRef(shaderInfo.InterlockedInstructionCount) = d3D12ShaderDescription.cInterlockedInstructions; + Unsafe.AsRef(shaderInfo.BitwiseInstructionCount) = d3D12ShaderReflection.Get()->GetBitwiseInstructionCount(); + Unsafe.AsRef(shaderInfo.MovcInstructionCount) = d3D12ShaderReflection.Get()->GetMovcInstructionCount(); + Unsafe.AsRef(shaderInfo.MovInstructionCount) = d3D12ShaderReflection.Get()->GetMovInstructionCount(); + Unsafe.AsRef(shaderInfo.InterfaceSlotCount) = d3D12ShaderReflection.Get()->GetNumInterfaceSlots(); + } + } +} diff --git a/src/ComputeSharp/Shaders/Interop/ShaderInfo.cs b/src/ComputeSharp/Shaders/Interop/ShaderInfo.cs new file mode 100644 index 00000000..fe962fbb --- /dev/null +++ b/src/ComputeSharp/Shaders/Interop/ShaderInfo.cs @@ -0,0 +1,128 @@ +namespace ComputeSharp.Interop +{ + /// + /// A model representing reflection info for a given compute shader. + /// + public readonly struct ShaderInfo + { + /// + /// The compiler version used to build the shader. + /// + public readonly string CompilerVersion; + + /// + /// The HLSL source code the shader was built from. + /// + public readonly string HlslSource; + + /// + /// The number of shader constant buffers. + /// + public readonly uint ConstantBufferCount; + + /// + /// The number of resource (textures and buffers) bound to a shader. + /// + public readonly uint BoundResourceCount; + + /// + /// The number of intermediate-language instructions in the compiled shader. + /// + public readonly uint InstructionCount; + + /// + /// The number of temporary registers in the compiled shader. + /// + public readonly uint TemporaryRegisterCount; + + /// + /// The number of temporary arrays used. + /// + public readonly uint TemporaryArrayCount; + + /// + /// The number of constant defines. + /// + public readonly uint ConstantDefineCount; + + /// + /// The number of declarations (input + output). + /// + public readonly uint DeclarationCount; + + /// + /// The number of non-categorized texture instructions. + /// + public readonly uint TextureNormalInstructions; + + /// + /// The number of texture load instructions. + /// + public readonly uint TextureLoadInstructionCount; + + /// + /// The number of texture write instructions. + /// + public readonly uint TextureStoreInstructionCount; + + /// + /// The number of floating point arithmetic instructions used. + /// + public readonly uint FloatInstructionCount; + + /// + /// The number of signed integer arithmetic instructions used. + /// + public readonly uint IntInstructionCount; + + /// + /// The number of unsigned integer arithmetic instructions used. + /// + public readonly uint UIntInstructionCount; + + /// + /// The number of static flow control instructions used. + /// + public readonly uint StaticFlowControlInstructionCount; + + /// + /// The number of dynamic flow control instructions used. + /// + public readonly uint DynamicFlowControlInstructionCount; + + /// + /// The number of emit instructions used. + /// + public readonly uint EmitInstructionCount; + + /// + /// The number of barrier instructions used. + /// + public readonly uint BarrierInstructionCount; + + /// + /// The number of interlocked instructions used. + /// + public readonly uint InterlockedInstructionCount; + + /// + /// The number of bitwise instructions used. + /// + public readonly uint BitwiseInstructionCount; + + /// + /// The number of movc instructions used. + /// + public readonly uint MovcInstructionCount; + + /// + /// The number of mov instructions used. + /// + public readonly uint MovInstructionCount; + + /// + /// The number of interface slots used. + /// + public readonly uint InterfaceSlotCount; + } +} diff --git a/src/ComputeSharp/Shaders/Renderer/HlslShaderRenderer.cs b/src/ComputeSharp/Shaders/Renderer/HlslShaderRenderer.cs new file mode 100644 index 00000000..1232512f --- /dev/null +++ b/src/ComputeSharp/Shaders/Renderer/HlslShaderRenderer.cs @@ -0,0 +1,313 @@ +using System; +using System.Buffers; +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using ComputeSharp.Shaders.Renderer.Models; +using ComputeSharp.Shaders.Translation; + +namespace ComputeSharp.Shaders.Renderer +{ + /// + /// A type that renders an HLSL template from the previously loaded shader data. + /// + internal static class HlslShaderRenderer + { + /// + /// Renders a new HLSL shader source with the given parameters. + /// + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + /// The input instance with the shader information. + /// The source code for the new HLSL shader. + [Pure] + public static ArrayPoolStringBuilder Render(int threadsX, int threadsY, int threadsZ, IShaderLoader info) + { + var builder = ArrayPoolStringBuilder.Create(); + + // Header + builder.AppendLine("// ================================================"); + builder.AppendLine("// AUTO GENERATED"); + builder.AppendLine("// ================================================"); + builder.AppendLine("// This shader was created by ComputeSharp."); + builder.AppendLine("// See: https://github.com/Sergio0694/ComputeSharp."); + + // Group size constants + builder.AppendLine(); + builder.Append("#define __GroupSize__get_X "); + builder.AppendLine(threadsX.ToString()); + builder.Append("#define __GroupSize__get_Y "); + builder.AppendLine(threadsY.ToString()); + builder.Append("#define __GroupSize__get_Z "); + builder.AppendLine(threadsZ.ToString()); + + // User defined onstants + foreach (var constant in info.ConstantsInfo) + { + builder.Append("#define "); + builder.Append(constant.Key); + builder.Append(' '); + builder.AppendLine(constant.Value); + } + + // Declared types + foreach (var type in info.DeclaredTypes) + { + builder.AppendLine(); + builder.AppendLine(type); + } + + // Captured variables + builder.AppendLine(); + builder.AppendLine("cbuffer _ : register(b0)"); + builder.AppendLine('{'); + builder.AppendLine(" uint __x;"); + builder.AppendLine(" uint __y;"); + builder.AppendLine(" uint __z;"); + + foreach (var local in info.FieldsInfo) + { + builder.Append(" "); + builder.Append(local.FieldType); + builder.Append(' '); + builder.Append(local.FieldName); + builder.AppendLine(';'); + } + + builder.AppendLine('}'); + + // Buffers + foreach (var buffer in info.HlslResourceInfo) + { + builder.AppendLine(); + + switch (buffer) + { + // Constant buffer go to cbuffer fields with a dummy local + case HlslResourceInfo.Constant _: + builder.Append("cbuffer _"); + builder.Append(buffer.FieldName); + builder.Append(" : register(b"); + builder.Append(buffer.BufferIndex.ToString()); + builder.AppendLine(')'); + builder.AppendLine('{'); + builder.Append(" "); + builder.Append(buffer.FieldType); + builder.Append(' '); + builder.Append(buffer.FieldName); + builder.AppendLine("[2];"); + builder.AppendLine('}'); + break; + + // Structured buffer have the same syntax but different id + case HlslResourceInfo.ReadOnly _: + char registerId = 't'; + goto StructuredBuffer; + case HlslResourceInfo.ReadWrite _: + registerId = 'u'; + StructuredBuffer: + builder.Append(buffer.FieldType); + builder.Append(' '); + builder.Append(buffer.FieldName); + builder.Append(" : register("); + builder.Append(registerId); + builder.Append(buffer.BufferIndex.ToString()); + builder.AppendLine(");"); + break; + } + } + + // Shared buffers + foreach (var buffer in info.SharedBuffers) + { + builder.AppendLine(); + builder.Append("groupshared "); + builder.Append(buffer.Value.Type); + builder.Append(' '); + builder.Append(buffer.Key); + builder.Append('['); + + if (buffer.Value.Count is int count) builder.Append(count.ToString()); + else builder.Append((threadsX * threadsY * threadsZ).ToString()); + + builder.AppendLine("];"); + } + + // Captured methods + foreach (var function in info.MethodsInfo) + { + builder.AppendLine(); + builder.AppendLine(function); + } + + // Entry point + builder.AppendLine(); + builder.AppendLine("[NumThreads(__GroupSize__get_X, __GroupSize__get_Y, __GroupSize__get_Z)]"); + builder.AppendLine(info.EntryPoint); + + return builder; + } + + /// + /// A helper type that implements a pooled buffer writer for values. + /// + [DebuggerTypeProxy(typeof(DebugView))] + public ref struct ArrayPoolStringBuilder + { + /// + /// The underlying array. + /// + private char[] array; + + /// + /// The starting offset within . + /// + private int index; + + /// + /// Creates a new instance ready to use. + /// + /// A new instance with default values. + [Pure] + public static ArrayPoolStringBuilder Create() + { + ArrayPoolStringBuilder builder; + + builder.array = ArrayPool.Shared.Rent(1024); + builder.index = 0; + + return builder; + } + + /// + public ReadOnlySpan WrittenSpan + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(this.array, 0, this.index); + } + + /// + /// Appends the input sequence of characters to the current buffer. + /// + /// The input characters to write. + public void Append(string value) + { + EnsureCapacity(value.Length); + + value.AsSpan().CopyTo(this.array.AsSpan(this.index)); + + this.index += value.Length; + } + + /// + /// Appends a character to the current buffer. + /// + public void Append(char character) + { + EnsureCapacity(1); + + this.array[this.index++] = character; + } + + /// + /// Appends the input sequence of characters to the current buffer, with a trailing new line. + /// + /// The input characters to write. + public void AppendLine(string value) + { + EnsureCapacity(value.Length + 1); + + value.AsSpan().CopyTo(this.array.AsSpan(this.index)); + + this.index += value.Length; + + this.array[this.index++] = '\n'; + } + + /// + /// Appends a character and a new line to the current buffer. + /// + public void AppendLine(char character) + { + EnsureCapacity(2); + + this.array[this.index++] = character; + this.array[this.index++] = '\n'; + } + + /// + /// Appends a new line to the current buffer. + /// + public void AppendLine() + { + EnsureCapacity(1); + + this.array[this.index++] = '\n'; + } + + /// + /// Ensures that has enough free space to contain a given number of new items. + /// + /// The minimum number of items to ensure space for in . + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void EnsureCapacity(int requestedSize) + { + if (requestedSize > this.array.Length - this.index) + { + ResizeBuffer(requestedSize); + } + } + + /// + /// Resizes to ensure it can fit the specified number of new items. + /// + /// The minimum number of items to ensure space for in . + [MethodImpl(MethodImplOptions.NoInlining)] + private void ResizeBuffer(int sizeHint) + { + int minimumSize = this.index + sizeHint; + + // Rent a new array with the specified size, and copy as many items from the current array + // as possible to the new array. This mirrors the behavior of the Array.Resize API from + // the BCL: if the new size is greater than the length of the current array, copy all the + // items from the original array into the new one. Otherwise, copy as many items as possible, + // until the new array is completely filled, and ignore the remaining items in the first array. + char[] newArray = ArrayPool.Shared.Rent(minimumSize); + int itemsToCopy = Math.Min(this.array.Length, minimumSize); + + Array.Copy(this.array, 0, newArray, 0, itemsToCopy); + + ArrayPool.Shared.Return(array); + + this.array = newArray; + } + + /// + public void Dispose() + { + ArrayPool.Shared.Return(this.array); + } + + /// + /// A debug proxy used for displaying debug info. + /// + internal sealed class DebugView + { + /// + /// Initializes a new instance of the class with the specified parameters. + /// + /// The input instance to display. + public DebugView(ArrayPoolStringBuilder builder) + { + Text = builder.WrittenSpan.ToString(); + } + + /// + /// Gets the text to display for the current instance. + /// + public string Text { get; } + } + } + } +} diff --git a/src/ComputeSharp/Shaders/Renderer/Models/HlslFieldInfo.cs b/src/ComputeSharp/Shaders/Renderer/Models/HlslFieldInfo.cs new file mode 100644 index 00000000..baf1f12c --- /dev/null +++ b/src/ComputeSharp/Shaders/Renderer/Models/HlslFieldInfo.cs @@ -0,0 +1,11 @@ +#pragma warning disable CS1572, CS1573 + +namespace ComputeSharp.Shaders.Renderer.Models +{ + /// + /// A model that contains info on a shader field. + /// + /// The type of the current field in the HLSL shader. + /// The name to use for the current field. + internal record CapturedFieldInfo(string FieldType, string FieldName); +} diff --git a/src/ComputeSharp/Shaders/Renderer/Models/HlslResourceInfo.cs b/src/ComputeSharp/Shaders/Renderer/Models/HlslResourceInfo.cs new file mode 100644 index 00000000..455b287d --- /dev/null +++ b/src/ComputeSharp/Shaders/Renderer/Models/HlslResourceInfo.cs @@ -0,0 +1,37 @@ +#pragma warning disable CS1572, CS1573 + +namespace ComputeSharp.Shaders.Renderer.Models +{ + /// + /// A model that contains info on a shader typed resource field. + /// + /// The type of the current field in the HLSL shader. + /// The name to use for the current field. + /// The register index to bind the resource to. + internal abstract record HlslResourceInfo(string FieldType, string FieldName, int BufferIndex) + : CapturedFieldInfo(FieldType, FieldName) + { + /// + /// A model that represents a captured constant buffer in a shader. + /// + /// + public sealed record Constant(string FieldType, string FieldName, int BufferIndex) + : HlslResourceInfo(FieldType, FieldName, BufferIndex); + + /// + /// A model that represents a captured readonly typed resource in a shader. + /// Maps to either or . + /// + /// + public sealed record ReadOnly(string FieldType, string FieldName, int BufferIndex) + : HlslResourceInfo(FieldType, FieldName, BufferIndex); + + /// + /// A model that represents a captured writeable buffer in a shader. + /// Maps to either or . + /// + /// + public sealed record ReadWrite(string FieldType, string FieldName, int BufferIndex) + : HlslResourceInfo(FieldType, FieldName, BufferIndex); + } +} diff --git a/src/ComputeSharp/Shaders/ShaderRunner{T}.cs b/src/ComputeSharp/Shaders/ShaderRunner{T}.cs new file mode 100644 index 00000000..eb03e3ff --- /dev/null +++ b/src/ComputeSharp/Shaders/ShaderRunner{T}.cs @@ -0,0 +1,219 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using ComputeSharp.Graphics.Commands; +using ComputeSharp.Graphics.Extensions; +using ComputeSharp.Shaders.Extensions; +using ComputeSharp.Shaders.Renderer; +using ComputeSharp.Shaders.Translation; +using ComputeSharp.Shaders.Translation.Interop; +using ComputeSharp.Shaders.Translation.Models; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; +using static TerraFX.Interop.D3D12_COMMAND_LIST_TYPE; + +namespace ComputeSharp.Shaders +{ + /// + /// A responsible for performing all the necessary operations to compile and run a compute shader. + /// + /// The type of compute shader to run. + internal static class ShaderRunner + where T : struct, IComputeShader + { + /// + /// The mapping used to cache and reuse compiled shaders. + /// + private static readonly Dictionary> ShadersCache = new(); + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The input instance representing the compute shader to run. + public static unsafe void Run(GraphicsDevice device, int x, int y, int z, in T shader) + { + // Here we calculate the optimized [numthreads] values. Using small thread group sizes leads to the + // best average performance due to better occupancy of the GPU with different shaders, using any + // number of registers and any amount of thread local storage. We use the wave size of the device in + // use for 1D dispatches, otherwise a multiple of 32 that is greater than or equal to 64, which still + // results in an evenly divisible number of waves per thread group on all existing GPU devices. + bool + xIs1 = x == 1, + yIs1 = y == 1, + zIs1 = z == 1; + int + mask = *(byte*)&xIs1 << 2 | *(byte*)&yIs1 << 1 | *(byte*)&zIs1, + threadsX, + threadsY, + threadsZ; + + switch (mask - 1) + { + case 0: // (_, _, 1) + threadsX = threadsY = 8; + threadsZ = 1; + break; + case 1: // (_, 1, _) + threadsX = threadsZ = 8; + threadsY = 1; + break; + case 2: // (_, 1, 1) + threadsX = (int)device.WavefrontSize; + threadsY = threadsZ = 1; + break; + case 3: // (1, _, _) + threadsX = 1; + threadsY = threadsZ = 8; + break; + case 4: // (1, _, 1) + threadsX = threadsZ = 1; + threadsY = (int)device.WavefrontSize; + break; + case 5: // (1, 1, _) + threadsX = threadsY = 1; + threadsZ = (int)device.WavefrontSize; + break; + default: // (_, _, _) + threadsX = threadsY = threadsZ = 4; + break; + } + + Run(device, x, y, z, threadsX, threadsY, threadsZ, in shader); + } + + /// + /// Compiles and runs the input shader on a target instance, with the specified parameters. + /// + /// The to use to run the shader. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + /// The input instance representing the compute shader to run. + public static unsafe void Run( + GraphicsDevice device, + int x, + int y, + int z, + int threadsX, + int threadsY, + int threadsZ, + in T shader) + { + device.ThrowIfDisposed(); + + Guard.IsGreaterThan(x, 0, nameof(x)); + Guard.IsGreaterThan(y, 0, nameof(y)); + Guard.IsGreaterThan(z, 0, nameof(z)); + Guard.IsBetweenOrEqualTo(threadsX, 1, 1024, nameof(threadsX)); + Guard.IsBetweenOrEqualTo(threadsY, 1, 1024, nameof(threadsY)); + Guard.IsBetweenOrEqualTo(threadsZ, 1, 64, nameof(threadsZ)); + Guard.IsLessThanOrEqualTo(threadsX * threadsY * threadsZ, 1024, "threadsXYZ"); + + // Calculate the dispatch values + int + groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1), + groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1), + groupsZ = Math.DivRem(z, threadsZ, out int modZ) + (modZ == 0 ? 0 : 1); + + Guard.IsBetweenOrEqualTo(groupsX, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + Guard.IsBetweenOrEqualTo(groupsY, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + Guard.IsBetweenOrEqualTo(groupsZ, 1, FX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX)); + + // Create the shader key + ShaderKey key = new(ShaderHashCodeProvider.GetHashCode(in shader), threadsX, threadsY, threadsZ); + CachedShader shaderData; + PipelineData? pipelineData; + + lock (ShadersCache) + { + // Get or preload the shader + if (!ShadersCache.TryGetValue(key, out shaderData)) + { + LoadShader(threadsX, threadsY, threadsZ, in shader, out shaderData); + + // Cache for later use + ShadersCache.Add(key, shaderData); + } + + // Create the reusable pipeline state + if (!shaderData.CachedPipelines.TryGetValue(device, out pipelineData)) + { + CreatePipelineData(device, shaderData, out pipelineData); + } + } + + // Create the commands list and set the pipeline state + using CommandList commandList = new(device, D3D12_COMMAND_LIST_TYPE_COMPUTE); + + commandList.D3D12GraphicsCommandList->SetComputeRootSignature(pipelineData.D3D12RootSignature); + commandList.D3D12GraphicsCommandList->SetPipelineState(pipelineData.D3D12PipelineState); + + // Extract the dispatch data for the shader invocation + using DispatchData dispatchData = shaderData.Loader.GetDispatchData(device, in shader, x, y, z); + + // Initialize the loop targets and the captured values + commandList.D3D12GraphicsCommandList->SetComputeRoot32BitConstants(dispatchData.Variables); + + ReadOnlySpan resources = dispatchData.Resources; + + for (int i = 0; i < resources.Length; i++) + { + // Load the captured buffers + commandList.D3D12GraphicsCommandList->SetComputeRootDescriptorTable((uint)i + 1, resources[i]); + } + + // Dispatch and wait for completion + commandList.D3D12GraphicsCommandList->Dispatch((uint)groupsX, (uint)groupsY, (uint)groupsZ); + commandList.ExecuteAndWaitForCompletion(); + } + + /// + /// Loads a shader with the specified parameters. + /// + /// The number of threads in each thread group for the X axis. + /// The number of threads in each thread group for the Y axis. + /// The number of threads in each thread group for the Z axis. + /// The input instance representing the compute shader to run. + /// The instance to return with the cached shader data. + [MethodImpl(MethodImplOptions.NoInlining)] + private static void LoadShader(int threadsX, int threadsY, int threadsZ, in T shader, out CachedShader shaderData) + { + // Load the input shader + ShaderLoader shaderLoader = ShaderLoader.Load(in shader); + + // Render the loaded shader + using var shaderSource = HlslShaderRenderer.Render(threadsX, threadsY, threadsZ, shaderLoader); + + // Compile the loaded shader to HLSL bytecode + IDxcBlobObject shaderBytecode = new(ShaderCompiler.Instance.CompileShader(shaderSource.WrittenSpan)); + + // Get the cached shader data + shaderData = new CachedShader(shaderLoader, shaderBytecode); + } + + /// + /// Creates and caches a instance for a given shader. + /// + /// The to use to run the shader. + /// The instance with the data on the loaded shader. + /// The resulting instance to use to run the shader. + [MethodImpl(MethodImplOptions.NoInlining)] + private static unsafe void CreatePipelineData(GraphicsDevice device, in CachedShader shaderData, out PipelineData pipelineData) + { + using ComPtr d3D12RootSignature = device.D3D12Device->CreateRootSignature(shaderData.Loader.D3D12Root32BitConstantsCount, shaderData.Loader.D3D12DescriptorRanges1); + using ComPtr d3D12PipelineState = device.D3D12Device->CreateComputePipelineState(d3D12RootSignature.Get(), shaderData.Bytecode.D3D12ShaderBytecode); + + pipelineData = new PipelineData(d3D12RootSignature.Get(), d3D12PipelineState.Get()); + + shaderData.CachedPipelines.Add(device, pipelineData); + } + } +} diff --git a/src/ComputeSharp/Shaders/Translation/IShaderLoader.cs b/src/ComputeSharp/Shaders/Translation/IShaderLoader.cs new file mode 100644 index 00000000..0ff336a8 --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/IShaderLoader.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using ComputeSharp.Shaders.Renderer.Models; + +namespace ComputeSharp.Shaders.Translation +{ + /// + /// A responsible for loading and processing shaders of any type. + /// + internal interface IShaderLoader + { + /// + /// Gets the generated source code for the method in the current shader. + /// + string EntryPoint { get; } + + /// + /// Gets the collection of items for the shader fields. + /// + IReadOnlyList HlslResourceInfo { get; } + + /// + /// Gets the collection of items for the shader fields. + /// + IReadOnlyList FieldsInfo { get; } + + /// + /// Gets the collection of methods to be used in the shader. + /// + IReadOnlyCollection MethodsInfo { get; } + + /// + /// Gets the collection of constants to be declared in the shader. + /// + IReadOnlyDictionary ConstantsInfo { get; } + + /// + /// Gets the collection of declared types for the shader. + /// + IReadOnlyCollection DeclaredTypes { get; } + + /// + /// Gets the collection of discovered constants. + /// + IReadOnlyDictionary SharedBuffers { get; } + } +} diff --git a/src/ComputeSharp/Shaders/Translation/Interop/IDxcBlobObject.cs b/src/ComputeSharp/Shaders/Translation/Interop/IDxcBlobObject.cs new file mode 100644 index 00000000..eb3cd02e --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/Interop/IDxcBlobObject.cs @@ -0,0 +1,38 @@ +using ComputeSharp.Interop; +using TerraFX.Interop; + +namespace ComputeSharp.Shaders.Translation.Interop +{ + /// + /// An object wrapping an instance. + /// + internal sealed unsafe class IDxcBlobObject : NativeObject + { + /// + /// The instance currently in use. + /// + private ComPtr dxcBlob; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance to wrap. + public IDxcBlobObject(ComPtr dxcBlob) + { + this.dxcBlob = dxcBlob; + } + + /// + /// Gets a raw pointer to the instance in use. + /// + public D3D12_SHADER_BYTECODE D3D12ShaderBytecode => new((ID3DBlob*)this.dxcBlob.Get()); + + /// + protected override bool OnDispose() + { + this.dxcBlob.Dispose(); + + return true; + } + } +} diff --git a/src/ComputeSharp/Shaders/Translation/Mappings/HlslKnownTypes.cs b/src/ComputeSharp/Shaders/Translation/Mappings/HlslKnownTypes.cs new file mode 100644 index 00000000..90aae996 --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/Mappings/HlslKnownTypes.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Numerics; + +namespace ComputeSharp.Shaders.Mappings +{ + /// + /// A that contains and maps known HLSL type names to common .NET types. + /// + internal static class HlslKnownTypes + { + /// + /// The set of HLSL vector types. + /// + private static HashSet HlslMappedVectorTypes { get; } = new(new[] + { + typeof(Bool2), typeof(Bool3), typeof(Bool4), + typeof(Int2), typeof(Int3), typeof(Int4), + typeof(UInt2), typeof(UInt3), typeof(UInt4), + typeof(Float2), typeof(Float3), typeof(Float4), + typeof(Double2), typeof(Double3), typeof(Double4) + }); + + /// + /// The set of HLSL matrix types. + /// + private static HashSet HlslMappedMatrixTypes { get; } = new(new[] + { + typeof(Bool1x1), typeof(Bool1x2), typeof(Bool1x3), typeof(Bool1x4), + typeof(Bool2x1), typeof(Bool2x2), typeof(Bool2x3), typeof(Bool2x4), + typeof(Bool3x1), typeof(Bool3x2), typeof(Bool3x3), typeof(Bool3x4), + typeof(Bool4x1), typeof(Bool4x2), typeof(Bool4x3), typeof(Bool4x4), + typeof(Int1x1), typeof(Int1x2), typeof(Int1x3), typeof(Int1x4), + typeof(Int2x1), typeof(Int2x2), typeof(Int2x3), typeof(Int2x4), + typeof(Int3x1), typeof(Int3x2), typeof(Int3x3), typeof(Int3x4), + typeof(Int4x1), typeof(Int4x2), typeof(Int4x3), typeof(Int4x4), + typeof(UInt1x1), typeof(UInt1x2), typeof(UInt1x3), typeof(UInt1x4), + typeof(UInt2x1), typeof(UInt2x2), typeof(UInt2x3), typeof(UInt2x4), + typeof(UInt3x1), typeof(UInt3x2), typeof(UInt3x3), typeof(UInt3x4), + typeof(UInt4x1), typeof(UInt4x2), typeof(UInt4x3), typeof(UInt4x4), + typeof(Float1x1), typeof(Float1x2), typeof(Float1x3), typeof(Float1x4), + typeof(Float2x1), typeof(Float2x2), typeof(Float2x3), typeof(Float2x4), + typeof(Float3x1), typeof(Float3x2), typeof(Float3x3), typeof(Float3x4), + typeof(Float4x1), typeof(Float4x2), typeof(Float4x3), typeof(Float4x4), + typeof(Double1x1), typeof(Double1x2), typeof(Double1x3), typeof(Double1x4), + typeof(Double2x1), typeof(Double2x2), typeof(Double2x3), typeof(Double2x4), + typeof(Double3x1), typeof(Double3x2), typeof(Double3x3), typeof(Double3x4), + typeof(Double4x1), typeof(Double4x2), typeof(Double4x3), typeof(Double4x4) + }); + + /// + /// Checks whether or not the input type is a known scalar type. + /// + /// The input instance to check. + /// A indicating whether the input is in fact a known HLSL scalar type. + [Pure] + public static bool IsKnownScalarType(Type type) => type == typeof(bool) || + type == typeof(Bool) || + type == typeof(int) || + type == typeof(uint) || + type == typeof(float) || + type == typeof(double); + + /// + /// Checks whether or not the input type is a known vector type. + /// + /// The input instance to check. + /// A indicating whether the input is in fact a known HLSL vector type. + [Pure] + public static bool IsKnownVectorType(Type type) => HlslMappedVectorTypes.Contains(type) || + type == typeof(Vector2) || + type == typeof(Vector3) || + type == typeof(Vector4); + + /// + /// Checks whether or not the input type is a known matrix type. + /// + /// The input instance to check. + /// A indicating whether the input is in fact a known HLSL matrix type. + [Pure] + public static bool IsKnownMatrixType(Type type) => HlslMappedMatrixTypes.Contains(type); + + /// + /// Checks whether or not the input type is a known buffer type. + /// + /// The input instance to check. + /// A indicating whether the input is in fact a known buffer type. + [Pure] + public static bool IsKnownBufferType(Type type) => IsConstantBufferType(type) || + IsReadOnlyResourceType(type) || + IsReadWriteResourceType(type); + + /// + /// Checks whether or not the input type is a value. + /// + /// The input instance to check. + /// A indicating whether the input is in fact a instance. + [Pure] + public static bool IsConstantBufferType(Type type) => type.IsGenericType && + type.GetGenericTypeDefinition() == typeof(ConstantBuffer<>); + + /// + /// Checks whether or not the input type is a known readonly resource type (buffer or texture). + /// + /// The input instance to check. + /// A indicating whether the input is a readonly resource type. + [Pure] + public static bool IsReadOnlyResourceType(Type type) + { + if (!type.IsGenericType) return false; + + Type genericType = type.GetGenericTypeDefinition(); + + return + genericType == typeof(ReadOnlyBuffer<>) || + genericType == typeof(ReadOnlyTexture2D<>) || + genericType == typeof(ReadOnlyTexture2D<,>) || + genericType == typeof(ReadOnlyTexture3D<>) || + genericType == typeof(ReadOnlyTexture3D<,>) || + genericType == typeof(IReadOnlyTexture2D<>) || + genericType == typeof(IReadOnlyTexture3D<>); + } + + /// + /// Checks whether or not the input type is a known writeable resource type (buffer or texture). + /// + /// The input instance to check. + /// A indicating whether the input is a writeable resource type. + [Pure] + public static bool IsReadWriteResourceType(Type type) + { + if (!type.IsGenericType) return false; + + Type genericType = type.GetGenericTypeDefinition(); + + return + genericType == typeof(ReadWriteBuffer<>) || + genericType == typeof(ReadWriteTexture2D<>) || + genericType == typeof(ReadWriteTexture2D<,>) || + genericType == typeof(ReadWriteTexture3D<>) || + genericType == typeof(ReadWriteTexture3D<,>) || + genericType == typeof(IReadWriteTexture2D<>) || + genericType == typeof(IReadWriteTexture3D<>); ; + } + } +} diff --git a/src/ComputeSharp.Shaders/Translation/Models/CachedShader{T}.cs b/src/ComputeSharp/Shaders/Translation/Models/CachedShader{T}.cs similarity index 57% rename from src/ComputeSharp.Shaders/Translation/Models/CachedShader{T}.cs rename to src/ComputeSharp/Shaders/Translation/Models/CachedShader{T}.cs index c92a96e4..da4de180 100644 --- a/src/ComputeSharp.Shaders/Translation/Models/CachedShader{T}.cs +++ b/src/ComputeSharp/Shaders/Translation/Models/CachedShader{T}.cs @@ -1,42 +1,41 @@ using System.Runtime.CompilerServices; -using ComputeSharp.Graphics; using ComputeSharp.Graphics.Commands; -using Vortice.Direct3D12; +using ComputeSharp.Shaders.Translation.Interop; namespace ComputeSharp.Shaders.Translation.Models { /// - /// A that contains info on a cached shader + /// A that contains info on a cached shader. /// - /// The type of compute shader in use + /// The type of compute shader in use. internal readonly struct CachedShader where T : struct, IComputeShader { /// - /// The instance with the shader metadata + /// The instance with the shader metadata. /// public readonly ShaderLoader Loader; /// - /// The compiled shader bytecode + /// The compiled shader bytecode. /// - public readonly ShaderBytecode Bytecode; + public readonly IDxcBlobObject Bytecode; /// - /// The map of cached instances for each GPU in use. + /// The map of cached instances for each GPU in use. /// - public readonly ConditionalWeakTable CachedPipelines; + public readonly ConditionalWeakTable CachedPipelines; /// - /// Creates a new instance with the specified parameters + /// Creates a new instance with the specified parameters. /// - /// The instance with the shader metadata - /// The compiled shader bytecode - public CachedShader(ShaderLoader loader, ShaderBytecode bytecode) + /// The instance with the shader metadata. + /// The compiled shader bytecode. + public CachedShader(ShaderLoader loader, IDxcBlobObject bytecode) { Loader = loader; Bytecode = bytecode; - CachedPipelines = new ConditionalWeakTable(); + CachedPipelines = new(); } } } diff --git a/src/ComputeSharp/Shaders/Translation/Models/DispatchData.cs b/src/ComputeSharp/Shaders/Translation/Models/DispatchData.cs new file mode 100644 index 00000000..249a3279 --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/Models/DispatchData.cs @@ -0,0 +1,87 @@ +using System; +using System.Buffers; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using TerraFX.Interop; + +namespace ComputeSharp.Shaders.Translation.Models +{ + /// + /// A that contains all the captured data to dispatch a shader. + /// + internal readonly ref struct DispatchData + { + /// + /// The array (actually values) with the captured buffers. + /// + private readonly ulong[] resourcesArray; + + /// + /// The number of values in . + /// + private readonly int resourcesCount; + + /// + /// The array with all the captured variables, with proper padding. + /// + private readonly byte[] variablesArray; + + /// + /// The actual size in bytes to use from . + /// + private readonly int variablesByteSize; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The array with the captured buffers. + /// The number of instances in . + /// The array with all the captured variables, with proper padding. + /// The actual size in bytes to use from . + public DispatchData(ulong[] resourcesArray, int resourcesCount, byte[] variablesArray, int variablesByteSize) + { + this.resourcesArray = resourcesArray; + this.variablesArray = variablesArray; + this.resourcesCount = resourcesCount; + this.variablesByteSize = variablesByteSize; + } + + /// + /// Gets a with all the captured buffers. + /// + public ReadOnlySpan Resources + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ref ulong r0 = ref MemoryMarshal.GetArrayDataReference(this.resourcesArray); + ref D3D12_GPU_DESCRIPTOR_HANDLE r1 = ref Unsafe.As(ref r0); + + return MemoryMarshal.CreateReadOnlySpan(ref r1, this.resourcesCount); + } + } + + /// + /// Gets a with the padded data representing all the captured variables. + /// + public unsafe ReadOnlySpan Variables + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ref byte r0 = ref MemoryMarshal.GetArrayDataReference(this.variablesArray); + ref uint r1 = ref Unsafe.As(ref r0); + int length = (int)((uint)this.variablesByteSize / sizeof(uint)); + + return MemoryMarshal.CreateReadOnlySpan(ref r1, length); + } + } + + /// + public void Dispose() + { + ArrayPool.Shared.Return(this.resourcesArray); + ArrayPool.Shared.Return(this.variablesArray); + } + } +} diff --git a/src/ComputeSharp.Shaders/Translation/Models/ShaderKey.cs b/src/ComputeSharp/Shaders/Translation/Models/ShaderKey.cs similarity index 85% rename from src/ComputeSharp.Shaders/Translation/Models/ShaderKey.cs rename to src/ComputeSharp/Shaders/Translation/Models/ShaderKey.cs index 1acaca5b..cc841752 100644 --- a/src/ComputeSharp.Shaders/Translation/Models/ShaderKey.cs +++ b/src/ComputeSharp/Shaders/Translation/Models/ShaderKey.cs @@ -4,37 +4,37 @@ using System.Runtime.CompilerServices; namespace ComputeSharp.Shaders.Translation.Models { /// - /// A representing a key for a given shader + /// A representing a key for a given shader. /// internal readonly struct ShaderKey : IEquatable { /// - /// The hashcode of the current shader type + /// The hashcode of the current shader type. /// private readonly int Id; /// - /// The number of iterations to run on the X axis + /// The number of iterations to run on the X axis. /// private readonly int ThreadsX; /// - /// The number of iterations to run on the Y axis + /// The number of iterations to run on the Y axis. /// private readonly int ThreadsY; /// - /// The number of iterations to run on the Z axis + /// The number of iterations to run on the Z axis. /// private readonly int ThreadsZ; /// - /// Creates a new instance with the specified parameters + /// Creates a new instance with the specified parameters. /// - /// The hashcode of the current shader type - /// The number of iterations to run on the X axis - /// The number of iterations to run on the Y axis - /// The number of iterations to run on the Z axis + /// The hashcode of the current shader type. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. [MethodImpl(MethodImplOptions.AggressiveInlining)] public ShaderKey(int id, int threadsX, int threadsY, int threadsZ) { diff --git a/src/ComputeSharp/Shaders/Translation/ShaderCompiler.LibraryLoading.cs b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.LibraryLoading.cs new file mode 100644 index 00000000..69f140cc --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.LibraryLoading.cs @@ -0,0 +1,62 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp.Shaders.Translation +{ + /// + internal sealed unsafe partial class ShaderCompiler + { + /// + /// Initializes the DLL resolvers for the dxcompiler.dll and dxil.dll libraries. + /// + private static void InitializeDxcLibrariesLoading() + { + // Test whether the native libraries are present in the same folder of the executable + // (which is the case when the program was built with a runtime identifier), or whether + // they are in the "runtimes\win-x64\native" folder in the executable directory. + string nugetNativeLibsPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native"); + bool isNuGetRuntimeLibrariesDirectoryPresent = Directory.Exists(nugetNativeLibsPath); + + // Register a custom library resolver for the two DXC libraries. We need to either manually load the two + // libraries from the NuGet directory, if an RID is not in use, or we need to ensure that dxil.dll is + // loaded correctly in case the program was executed with the host being in another directory. + // This happens when doing eg. "dotnet bin\Debug\net5.0\MyApp.dll", which would crash at runtime. + FX.ResolveLibrary += (libraryName, assembly, searchPath) => + { + if (libraryName is not "dxcompiler") return IntPtr.Zero; + + if (isNuGetRuntimeLibrariesDirectoryPresent) + { + string + dxcompilerPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native\dxcompiler.dll"), + dxilPath = Path.Combine(AppContext.BaseDirectory, @"runtimes\win-x64\native\dxil.dll"); + + // Load DXIL first so that DXC doesn't fail to load it, and then DXIL, both from the NuGet path + if (NativeLibrary.TryLoad(dxilPath, out _) && NativeLibrary.TryLoad(dxcompilerPath, out IntPtr handle)) + { + return handle; + } + } + else + { + // Even when the two libraries are correctly copied next to the executable in use, we load them + // manually to ensure the operation is successful. This is to avoid failures in cases such as when + // doing "dotnet bin\MyApp.dll", ie. when the host is in another path than the executable in use. + // This is probably because DXIL is a native dependency for DXC, but the way Windows loads these + // libraries doesn't take into account the .NET concepts of "app directory": neither the current "bin" + // directory nor the "process directory", which is "C:\Program Files\dotnet", actually contain the + // native library we need, hence the runtime crash. Manually loading the library this way solves this. + if (NativeLibrary.TryLoad("dxil", assembly, searchPath, out _) && + NativeLibrary.TryLoad("dxcompiler", assembly, searchPath, out IntPtr handle)) + { + return handle; + } + } + + return IntPtr.Zero; + }; + } + } +} diff --git a/src/ComputeSharp/Shaders/Translation/ShaderCompiler.cs b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.cs new file mode 100644 index 00000000..96332b55 --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/ShaderCompiler.cs @@ -0,0 +1,156 @@ +using System; +using System.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using ComputeSharp.Core.Extensions; +using ComputeSharp.Exceptions; +using TerraFX.Interop; +using FX = TerraFX.Interop.Windows; + +namespace ComputeSharp.Shaders.Translation +{ + /// + /// A that uses the DXC APIs to compile compute shaders. + /// + internal sealed unsafe partial class ShaderCompiler + { + /// + /// The thread local instance. + /// This is necessary because the DXC library is strictly single-threaded. + /// + [ThreadStatic] + private static ShaderCompiler? instance; + + /// + /// The instance to use to create the bytecode for HLSL sources. + /// + private readonly ComPtr DxcCompiler; + + /// + /// The instance to use to work with . + /// + private readonly ComPtr DxcLibrary; + + /// + /// The instance used to compile shaders with . + /// + private readonly ComPtr DxcIncludeHandler; + + /// + /// Creates a new instance. + /// + private ShaderCompiler() + { + lock(this) + { + InitializeDxcLibrariesLoading(); + } + + using ComPtr dxcCompiler = default; + using ComPtr dxcLibrary = default; + using ComPtr dxcIncludeHandler = default; + + Guid dxcCompilerCLGuid = FX.CLSID_DxcCompiler; + Guid dxcLibraryCLGuid = FX.CLSID_DxcLibrary; + + FX.DxcCreateInstance(&dxcCompilerCLGuid, FX.__uuidof(), dxcCompiler.GetVoidAddressOf()).Assert(); + FX.DxcCreateInstance(&dxcLibraryCLGuid, FX.__uuidof(), dxcLibrary.GetVoidAddressOf()).Assert(); + + dxcLibrary.Get()->CreateIncludeHandler(dxcIncludeHandler.GetAddressOf()).Assert(); + + DxcCompiler = dxcCompiler.Move(); + DxcLibrary = dxcLibrary.Move(); + DxcIncludeHandler = dxcIncludeHandler.Move(); + } + + /// + /// Destroys the current instance. + /// + ~ShaderCompiler() + { + DxcCompiler.Dispose(); + DxcLibrary.Dispose(); + DxcIncludeHandler.Dispose(); + } + + /// + /// Gets a instance to use. + /// + public static ShaderCompiler Instance => instance ??= new(); + + /// + /// Compiles a new HLSL shader from the input source code. + /// + /// The HLSL source code to compile. + /// The bytecode for the compiled shader. + [Pure] + public ComPtr CompileShader(ReadOnlySpan source) + { + using ComPtr dxcBlobEncoding = default; + using ComPtr dxcOperationResult = default; + using ComPtr dxcBlobBytecode = default; + + // Get the encoded blob from the source code + fixed (char* p = source) + { + DxcLibrary.Get()->CreateBlobWithEncodingOnHeapCopy( + p, + (uint)source.Length * 2, + 1200, + dxcBlobEncoding.GetAddressOf()).Assert(); + } + + // Try to compile the new compute shader + fixed (char* shaderName = "") + fixed (char* entryPoint = nameof(IComputeShader.Execute)) + fixed (char* shaderProfile = "cs_6_0") + fixed (char* optimization = "-O3") + fixed (char* rowMajor = "-Zpr") + { + char** arguments = stackalloc char*[2] { optimization, rowMajor }; + + DxcCompiler.Get()->Compile( + (IDxcBlob*)dxcBlobEncoding.Get(), + (ushort*)shaderName, + (ushort*)entryPoint, + (ushort*)shaderProfile, + (ushort**)arguments, + 2, + null, + 0, + DxcIncludeHandler.Get(), + dxcOperationResult.GetAddressOf()).Assert(); + } + + int status; + + dxcOperationResult.Get()->GetStatus(&status).Assert(); + + // The compilation was successful, so we can extract the shader bytecode + if (status == 0) + { + dxcOperationResult.Get()->GetResult(dxcBlobBytecode.GetAddressOf()).Assert(); + + return dxcBlobBytecode.Move(); + } + + return ThrowHslsCompilationException(dxcOperationResult); + } + + /// + /// Throws an exception when a shader compilation fails. + /// + /// The input (faulting) operation. + /// This method always throws and never actually returs. + [MethodImpl(MethodImplOptions.NoInlining)] + private static ComPtr ThrowHslsCompilationException(IDxcOperationResult* dxcOperationResult) + { + using ComPtr dxcBlobEncodingError = default; + + dxcOperationResult->GetErrorBuffer(dxcBlobEncodingError.GetAddressOf()).Assert(); + + string message = new((sbyte*)dxcBlobEncodingError.Get()->GetBufferPointer()); + + throw new HlslCompilationException(message); + } + } +} diff --git a/src/ComputeSharp/Shaders/Translation/ShaderHashCodeProvider.cs b/src/ComputeSharp/Shaders/Translation/ShaderHashCodeProvider.cs new file mode 100644 index 00000000..d6139881 --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/ShaderHashCodeProvider.cs @@ -0,0 +1,75 @@ +using System; +using System.Diagnostics.Contracts; +using System.Reflection; +using System.Runtime.CompilerServices; + +namespace ComputeSharp.Shaders.Translation +{ + /// + /// A that handles the cache system for the generated shaders. + /// + internal static class ShaderHashCodeProvider + { + /// + /// A type containing static info for a given shader type . + /// + /// The type of compute shader currently in use. + private static class TypeInfo + where T : struct, IComputeShader + { + /// + /// The id of the compute shader type in use. + /// + public static readonly int Id; + + /// + /// The optional instance, if needed. + /// + public static readonly Hasher? Hasher; + + /// + /// Initializes the static members of the type. + /// + static TypeInfo() + { + Id = HashCode.Combine(typeof(T)); + + // Get the generated hasher, if one if present + if (typeof(T).Assembly.GetType("ComputeSharp.__Internals.HashCodeProvider") is Type type && + type.GetMethod("CombineHash", new[] { typeof(int), typeof(T).MakeByRefType() }) is MethodInfo method) + { + Hasher = method.CreateDelegate>(); + } + } + } + + /// + /// Gets a unique hashcode for the input compute shader instance. + /// + /// The type of compute shader currently in use. + /// The input instance representing the shader to run. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int GetHashCode(in T shader) + where T : struct, IComputeShader + { + int hash = TypeInfo.Id; + + Hasher? hasher = TypeInfo.Hasher; + + if (hasher != null) hash = hasher(hash, in shader); + + return hash; + } + + /// + /// A that represents an aggregate hash function for a given instance. + /// + /// The type of compute shader currently in use. + /// The initial hash value. + /// The compute shader instance to use to compute the final hash value. + /// The final hash value for the input closure. + private delegate int Hasher(int hash, in T shader) + where T : struct, IComputeShader; + } +} diff --git a/src/ComputeSharp/Shaders/Translation/ShaderLoader{T}.DispatchData.cs b/src/ComputeSharp/Shaders/Translation/ShaderLoader{T}.DispatchData.cs new file mode 100644 index 00000000..80b0d868 --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/ShaderLoader{T}.DispatchData.cs @@ -0,0 +1,93 @@ +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using ComputeSharp.__Internals; +using ComputeSharp.Shaders.Translation.Models; +using TerraFX.Interop; + +#pragma warning disable CS0419, CS0618 + +namespace ComputeSharp.Shaders.Translation +{ + /// + internal sealed partial class ShaderLoader + { + /// + /// A that loads all the captured members from a shader instance. + /// + /// The to use to run the shader. + /// The shader instance to load the data from. + /// + /// A reference to the buffer with all the captured instances. + /// This is just represented as a reference, to avoid exposing the type publicly. + /// + /// A reference to the buffer to use to store all the captured value types. + /// The returned value indicates the total number of written bytes into . + private delegate int DispatchDataLoader(GraphicsDevice device, in T shader, ref ulong r0, ref byte r1); + + /// + /// The number of captured graphics resources (buffers). + /// + private int totalResourceCount; + + /// + /// The cached instance to load dispatch data before execution. + /// + private DispatchDataLoader? dispatchDataLoader; + + /// + /// The of instances mapping the captured variables in the current shader. + /// + private readonly List capturedFields = new(); + + /// + /// Gets a new instance with all the captured data for the current shader instance. + /// + /// The to use to run the shader. + /// The input instance representing the compute shader to run. + /// The number of iterations to run on the X axis. + /// The number of iterations to run on the Y axis. + /// The number of iterations to run on the Z axis. + [Pure] + public DispatchData GetDispatchData(GraphicsDevice device, in T shader, int x, int y, int z) + { + // Resources and variables buffers + ulong[] resources = ArrayPool.Shared.Rent(this.totalResourceCount); + byte[] variables = ArrayPool.Shared.Rent(256); + + ref ulong r0 = ref MemoryMarshal.GetArrayDataReference(resources); + ref byte r1 = ref MemoryMarshal.GetArrayDataReference(variables); + + // Set the x, y and z counters + Unsafe.As(ref r1) = x; + Unsafe.Add(ref Unsafe.As(ref r1), 1) = y; + Unsafe.Add(ref Unsafe.As(ref r1), 2) = z; + + // Invoke the dynamic method to extract the captured data + int totalVariablesByteSize = this.dispatchDataLoader!(device, in shader, ref r0, ref r1); + + return new(resources, this.totalResourceCount, variables, totalVariablesByteSize); + } + + /// + /// Initializes the instance that loads the dispatch data for the current shader type. + /// + private void InitializeDispatchDataLoader() + { + // Get the generated data loader + Type[] argumentTypes = new[] { typeof(GraphicsDevice), typeof(T).MakeByRefType(), typeof(ulong).MakeByRefType(), typeof(byte).MakeByRefType() }; + Type type = typeof(T).Assembly.GetType("ComputeSharp.__Internals.DispatchDataLoader")!; + MethodInfo method = type.GetMethod("LoadDispatchData", argumentTypes)!; + + // Extract the computed count of 32 bit root constants to load + D3D12Root32BitConstantsCount = ((ComputeRoot32BitConstantsAttribute)method.ReturnTypeCustomAttributes.GetCustomAttributes(false)[0]).Count; + + // Create a delegate from the generated shader data loader + this.dispatchDataLoader = method.CreateDelegate(); + } + } +} diff --git a/src/ComputeSharp/Shaders/Translation/ShaderLoader{T}.cs b/src/ComputeSharp/Shaders/Translation/ShaderLoader{T}.cs new file mode 100644 index 00000000..e0495df5 --- /dev/null +++ b/src/ComputeSharp/Shaders/Translation/ShaderLoader{T}.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; +using ComputeSharp.__Internals; +using ComputeSharp.Shaders.Mappings; +using ComputeSharp.Shaders.Renderer.Models; +using Microsoft.Toolkit.Diagnostics; +using TerraFX.Interop; +using static TerraFX.Interop.D3D12_DESCRIPTOR_RANGE_TYPE; + +#pragma warning disable CS0419, CS0618, CS8618 + +namespace ComputeSharp.Shaders.Translation +{ + /// + /// A responsible for loading and processing shaders of a given type. + /// + /// The type of compute shader currently in use. + internal sealed partial class ShaderLoader : IShaderLoader + where T : struct, IComputeShader + { + /// + /// The associated instance for the current shader type. + /// + private static readonly IComputeShaderSourceAttribute Attribute = IComputeShaderSourceAttribute.GetForType(); + + /// + /// The number of constant buffers to define in the shader. + /// + /// + /// This starts at 1 as there's always an initial constant buffer before user-defined ones, containing + /// the captured scalar and vector values as well as the iteration ranges for the shader dispatch. + /// + private uint constantBuffersCount = 1; + + /// + /// The number of readonly buffers to define in the shader. + /// + private uint readOnlyBuffersCount; + + /// + /// The number of read write buffers to define in the shader. + /// + private uint readWriteBuffersCount; + + /// + /// The array of items that are required to load the captured values. + /// + private D3D12_DESCRIPTOR_RANGE1[] d3D12DescriptorRanges1; + + /// + /// The with the items for the shader fields. + /// + private readonly List hlslResourceInfo = new(); + + /// + /// The with the items for the shader fields. + /// + private readonly List fieldsInfo = new(); + + /// + /// The with the collected methods for the shader. + /// + private readonly List methodsInfo = new(); + + /// + /// The with the discovered constants for the shader. + /// + private readonly Dictionary constantsInfo = new(); + + /// + /// The with the collected declared types for the shader. + /// + private readonly List declaredTypes = new(); + + /// + /// Creates a new instance. + /// + private ShaderLoader() + { + } + + /// + /// Gets the number of 32 bit constants in the root signature for the shader. + /// + public int D3D12Root32BitConstantsCount { get; private set; } + + /// + /// Gets a with the loaded items for the shader. + /// + public ReadOnlySpan D3D12DescriptorRanges1 + { + get => this.d3D12DescriptorRanges1; + } + + /// + public string EntryPoint { get; private set; } + + /// + public IReadOnlyList HlslResourceInfo => this.hlslResourceInfo; + + /// + public IReadOnlyList FieldsInfo => this.fieldsInfo; + + /// + public IReadOnlyCollection MethodsInfo => this.methodsInfo; + + /// + public IReadOnlyDictionary ConstantsInfo => this.constantsInfo; + + /// + public IReadOnlyCollection DeclaredTypes => this.declaredTypes; + + /// + public IReadOnlyDictionary SharedBuffers { get; private set; } + + /// + /// Loads and processes an input shadeer. + /// + /// The instance to use to build the shader. + /// A new instance representing the input shader. + [Pure] + public static ShaderLoader Load(in T shader) + { + ShaderLoader @this = new(); + + @this.LoadMethodMetadata(); + + // Reading members through reflection requires an object parameter, so here we're just boxing + // the input shader once to avoid allocating it multiple times while processing the shader. + @this.d3D12DescriptorRanges1 = @this.LoadFieldsInfo(shader); + + @this.InitializeDispatchDataLoader(); + + return @this; + } + + /// + /// Loads the metadata info for the current shader. + /// + private void LoadMethodMetadata() + { + EntryPoint = Attribute.ExecuteMethod; + SharedBuffers = Attribute.SharedBuffers; + + this.declaredTypes.AddRange(Attribute.Types); + this.methodsInfo.AddRange(Attribute.Methods); + + foreach (var pair in Attribute.Constants) + { + this.constantsInfo.Add(pair.Key, pair.Value); + } + } + + /// + /// Loads the fields info for the current shader being loaded. + /// + /// The boxed instance to use to build the shader. + /// The array of items that are required to load the captured values. + private D3D12_DESCRIPTOR_RANGE1[] LoadFieldsInfo(object shader) + { + IReadOnlyList shaderFields = typeof(T).GetFields( + BindingFlags.Instance | + BindingFlags.Public | + BindingFlags.NonPublic).ToArray(); + + if (shaderFields.Count == 0) + { + ThrowHelper.ThrowInvalidOperationException("The shader body must contain at least one field"); + } + + List d3D12DescriptorRanges1 = new(); + + // Inspect the captured fields + foreach (FieldInfo fieldInfo in shaderFields) + { + LoadFieldInfo(shader, fieldInfo, d3D12DescriptorRanges1); + } + + return d3D12DescriptorRanges1.ToArray(); + } + + /// + /// Loads a specified and adds it to the shader model. + /// + /// The boxed instance to use to build the shader. + /// The target to load. + /// The list of discovered values. + private void LoadFieldInfo(object shader, FieldInfo fieldInfo, List d3D12DescriptorRanges1) + { + Type fieldType = fieldInfo.FieldType; + (string hlslName, string hlslType) = Attribute.Fields[fieldInfo.Name]; + + if (HlslKnownTypes.IsConstantBufferType(fieldType)) + { + d3D12DescriptorRanges1.Add(new D3D12_DESCRIPTOR_RANGE1(D3D12_DESCRIPTOR_RANGE_TYPE_CBV, 1, this.constantBuffersCount)); + + this.capturedFields.Add(fieldInfo); + this.hlslResourceInfo.Add(new HlslResourceInfo.Constant(hlslType, hlslName, (int)this.constantBuffersCount++)); + this.totalResourceCount++; + } + else if (HlslKnownTypes.IsReadOnlyResourceType(fieldType)) + { + d3D12DescriptorRanges1.Add(new D3D12_DESCRIPTOR_RANGE1(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, this.readOnlyBuffersCount)); + + this.capturedFields.Add(fieldInfo); + this.hlslResourceInfo.Add(new HlslResourceInfo.ReadOnly(hlslType, hlslName, (int)this.readOnlyBuffersCount++)); + this.totalResourceCount++; + } + else if (HlslKnownTypes.IsReadWriteResourceType(fieldType)) + { + d3D12DescriptorRanges1.Add(new D3D12_DESCRIPTOR_RANGE1(D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, this.readWriteBuffersCount)); + + this.capturedFields.Add(fieldInfo); + this.hlslResourceInfo.Add(new HlslResourceInfo.ReadWrite(hlslType, hlslName, (int)this.readWriteBuffersCount++)); + this.totalResourceCount++; + } + else if (HlslKnownTypes.IsKnownScalarType(fieldType) || HlslKnownTypes.IsKnownVectorType(fieldType) || HlslKnownTypes.IsKnownMatrixType(fieldType)) + { + this.capturedFields.Add(fieldInfo); + this.fieldsInfo.Add(new CapturedFieldInfo(hlslType, hlslName)); + } + else if (fieldInfo.GetValue(shader) is Delegate { Method: { IsStatic: true } } func) + { + // Captured static delegates with a return type + var methodSource = ShaderMethodSourceAttribute.GetForDelegate(func); + + this.declaredTypes.AddRange(methodSource.Types); + this.methodsInfo.Add(methodSource.GetMappedInvokeMethod(hlslName)); + this.methodsInfo.AddRange(methodSource.Methods); + + foreach (var pair in methodSource.Constants) + { + this.constantsInfo[pair.Key] = pair.Value; + } + } + else ThrowHelper.ThrowArgumentException("Invalid captured variable"); + } + } +} diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 00000000..d780b22a --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,11 @@ + + + 2.0.0.0 + + + + + + + + \ No newline at end of file diff --git a/tests/ComputeSharp.Tests.Internals.SourceGenerators/AutoConstructorGeneratorTests.cs b/tests/ComputeSharp.Tests.Internals.SourceGenerators/AutoConstructorGeneratorTests.cs new file mode 100644 index 00000000..487b41c1 --- /dev/null +++ b/tests/ComputeSharp.Tests.Internals.SourceGenerators/AutoConstructorGeneratorTests.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using ComputeSharp.SourceGenerators; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests.Internals +{ + [TestClass] + [TestCategory("AutoConstructorGenerator")] + public class AutoConstructorGeneratorTests + { + [TestMethod] + public void GenerateConstructor() + { + string source = @" + using System.Numerics; + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public partial interface IFoo : IFluff + where T : notnull, new() + { + public partial class Foo + { + [AutoConstructor] + public readonly partial struct Test + { + private readonly float a; + private readonly Vector2 b; + public readonly ReadWriteBuffer c; + public readonly ReadWriteBuffer d; + } + } + } + }"; + + string expected = @" + namespace MyFancyApp.Sample + { + public partial interface IFoo + { + public partial class Foo + { + public readonly partial struct Test + { + public Test(float a, System.Numerics.Vector2 b, ComputeSharp.ReadWriteBuffer c, ComputeSharp.ReadWriteBuffer d) + { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } + } + } + } + }"; + + VerifyGeneratedMethodLines(source, 0, expected); + } + + /// + /// Verifies the output of a source generator. + /// + /// The generator type to use. + /// The input source to process. + /// The target index to check in the resulting output. + /// The expected body to compare with the generated code. + private void VerifyGeneratedMethodLines(string source, int index, string expectedBody) + where TGenerator : class, ISourceGenerator, new() + { + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); + + IEnumerable references = + from assembly in AppDomain.CurrentDomain.GetAssemblies() + where !assembly.IsDynamic + let reference = MetadataReference.CreateFromFile(assembly.Location) + select reference; + + CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + + ISourceGenerator generator = new TGenerator(); + + CSharpGeneratorDriver driver = CSharpGeneratorDriver.Create(generator); + + driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray diagnostics); + + string outputBody = outputCompilation.SyntaxTrees.Skip(index + 1).First().ToString(); + + string[] + outputLines = outputBody.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries), + expectedLines = expectedBody.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); + + Assert.AreEqual(expectedLines.Length, outputLines.Length); + + for (int i = 0; i < outputLines.Length; i++) + { + Assert.AreEqual(expectedLines[i], outputLines[i]); + } + } + } +} \ No newline at end of file diff --git a/tests/ComputeSharp.Tests.Internals.SourceGenerators/ComputeSharp.Tests.Internals.SourceGenerators.csproj b/tests/ComputeSharp.Tests.Internals.SourceGenerators/ComputeSharp.Tests.Internals.SourceGenerators.csproj new file mode 100644 index 00000000..a41e2484 --- /dev/null +++ b/tests/ComputeSharp.Tests.Internals.SourceGenerators/ComputeSharp.Tests.Internals.SourceGenerators.csproj @@ -0,0 +1,19 @@ + + + + net5.0 + false + + + + + + + + + + + + + + diff --git a/tests/ComputeSharp.Tests.Internals.SourceGenerators/DiagnosticsTests.cs b/tests/ComputeSharp.Tests.Internals.SourceGenerators/DiagnosticsTests.cs new file mode 100644 index 00000000..40ea4c4a --- /dev/null +++ b/tests/ComputeSharp.Tests.Internals.SourceGenerators/DiagnosticsTests.cs @@ -0,0 +1,1172 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using ComputeSharp.SourceGenerators; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests.Internals +{ + [TestClass] + [TestCategory("Diagnostics")] + public class DiagnosticsTests + { + [TestMethod] + public void InvalidShaderField() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + public string text; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0001"); + } + + [TestMethod] + public void InvalidGroupSharedFieldType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public class GroupSharedAttribute : Attribute { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + [GroupShared] + public static string text; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0002"); + } + + [TestMethod] + public void InvalidGroupSharedFieldElementType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public class GroupSharedAttribute : Attribute { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + [GroupShared] + public static string[] text; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0003"); + } + + [TestMethod] + public void InvalidGroupSharedFieldDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public class GroupSharedAttribute : Attribute { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + [GroupShared] + public ReadWriteBuffer buffer; + + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0004"); + } + + [TestMethod] + public void MissingShaderResources() + { + string source = @" + using ComputeSharp; + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public void Execute() { } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0005"); + } + + [TestMethod] + [DataRow(nameof(ThreadIds), "CMPS0006")] + [DataRow(nameof(GroupIds), "CMPS0007")] + [DataRow(nameof(GroupSize), "CMPS0008")] + [DataRow(nameof(WarpIds), "CMPS0009")] + public void InvalidDispatchInfoUsage_LocalFunction(string typeName, string diagnosticsId) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + public static class {typeName} {{ public static int X => 0; }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public void Execute() + {{ + static int Fail() => {typeName}.X; + + Fail(); + }} + }} + }}"; + + VerifyGeneratedDiagnostics(source, diagnosticsId); + } + + [TestMethod] + [DataRow(nameof(ThreadIds), "CMPS0006")] + [DataRow(nameof(GroupIds), "CMPS0007")] + [DataRow(nameof(GroupSize), "CMPS0008")] + [DataRow(nameof(WarpIds), "CMPS0009")] + public void InvalidDispatchInfoUsage_StaticMethod(string typeName, string diagnosticsId) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + public static class {typeName} {{ public static int X => 0; }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public static int Fail() => {typeName}.X; + + public void Execute() => Fail(); + }} + }}"; + + VerifyGeneratedDiagnostics(source, diagnosticsId); + } + + [TestMethod] + public void InvalidObjectCreationExpression_Explicit() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + object o = new object(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0010"); + } + + [TestMethod] + public void InvalidObjectCreationExpression_Implicit() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + object o = new(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0010"); + } + + [TestMethod] + public void AnonymousObjectCreationExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + var o = new { Age = 12 }; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0011"); + } + + [TestMethod] + public void AsyncModifierOnMethodOrFunction_LocalFunction() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + static async void Fail() { } + + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0012"); + } + + [TestMethod] + public void AsyncModifierOnMethodOrFunction_StaticMethod() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public static async void Fail() { } + + public void Execute() => Fail(); + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0012"); + } + + [TestMethod] + public void AwaitExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public async void Execute() + { + await null; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0012", "CMPS0013"); + } + + [TestMethod] + [DataRow("checked")] + [DataRow("unchecked")] + public void CheckedExpression(string text) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public void Execute() + {{ + int a = {text}(1 + 1); + }} + }} + }}"; + + VerifyGeneratedDiagnostics(source, "CMPS0014"); + } + + [TestMethod] + [DataRow("checked")] + [DataRow("unchecked")] + public void CheckedStatement(string text) + { + string source = $@" + using ComputeSharp; + + namespace ComputeSharp + {{ + public class ReadWriteBuffer {{ }} + }} + + namespace MyFancyApp.Sample + {{ + public struct MyShader : IComputeShader + {{ + public ReadWriteBuffer buffer; + + public void Execute() + {{ + {text} + {{ + int a = 1 + 1; + }} + }} + }} + }}"; + + VerifyGeneratedDiagnostics(source, "CMPS0015"); + } + + [TestMethod] + public void FixedStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + fixed (void* p = buffer.Data) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0016", "CMPS0032"); + } + + [TestMethod] + public void ForEachStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + foreach (int i in buffer.Data) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0017"); + } + + [TestMethod] + public void LockStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + lock (buffer) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0018"); + } + + [TestMethod] + public void QueryExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = from x in buffer.Data select x; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0019"); + } + + [TestMethod] + public void RangeExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int[] Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = buffer.Data[1..]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0020"); + } + + [TestMethod] + public void RecursivePattern() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public object Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + if (buffer.Data is int[] { Length: 50 } foo) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0021"); + } + + [TestMethod] + public void RefType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public ref T this[int x] => throw null; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + ref float x = ref buffer[0]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0022"); + } + + [TestMethod] + public void RelationalPattern() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer + { + public int Data; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + if (buffer.Data is > 0 and < 10) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0023"); + } + + [TestMethod] + public void SizeOfExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = sizeof(float); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0024"); + } + + [TestMethod] + public void StackAllocArrayCreationExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + int* p = stackalloc int[10]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0032", "CMPS0025"); + } + + [TestMethod] + public void ThrowExpressionOrStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + throw null; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0026"); + } + + [TestMethod] + public void TryStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + try + { + } + catch + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0027"); + } + + [TestMethod] + public void TupleType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + (int, float) foo; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0028"); + } + + [TestMethod] + public void UsingDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + using IDisposable foo = null + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0029"); + } + + [TestMethod] + public void UsingStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + using (IDisposable foo = null) + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0029"); + } + + [TestMethod] + public void YieldStatement() + { + string source = @" + using System.Collections.Generic; + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public static IEnumerable Fail() + { + yield return 3.14f; + } + + public void Execute() + { + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0030"); + } + + [TestMethod] + public void InvalidObjectDeclaration() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + string bar; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0031"); + } + + [TestMethod] + public void PointerType() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + int* p; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0032"); + } + + [TestMethod] + public void FunctionPointer() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + delegate* f; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0033"); + } + + [TestMethod] + public void UnsafeStatement() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + unsafe + { + } + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0034"); + } + + [TestMethod] + public void UnsafeModifier_LocalFunction() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + static unsafe void Fail() { } + + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0035"); + } + + [TestMethod] + public void UnsafeModifier_StaticMethod() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public static unsafe void Fail() { } + + public ReadWriteBuffer buffer; + + public void Execute() + { + Fail(); + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0035"); + } + + [TestMethod] + public void StringLiteralExpression() + { + string source = @" + using ComputeSharp; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + _ = ""Hello world""; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0036"); + } + + [TestMethod] + public void NonConstantMatrixSwizzledIndex() + { + string source = @" + using ComputeSharp; + using static ComputeSharp.MatrixIndex; + + namespace ComputeSharp + { + public class ReadWriteBuffer { } + public enum MatrixIndex + { + M11, + M12, + M13 + }, + public struct Float4 { } + public struct Float4x4 + { + public Float4 this[MatrixIndex m0, MatrixIndex m1, MatrixIndex m2, MatrixIndex m3] => default; + } + } + + namespace MyFancyApp.Sample + { + public struct MyShader : IComputeShader + { + public ReadWriteBuffer buffer; + + public void Execute() + { + Float4x4 m = default; + MatrixIndex index = M12; + Float4 = m[M11, index, M13, M11]; + } + } + }"; + + VerifyGeneratedDiagnostics(source, "CMPS0042"); + } + + /// + /// Verifies the output of a source generator. + /// + /// The generator type to use. + /// The input source to process. + /// The target index to check in the resulting output. + /// The expected body to compare with the generated code. + private void VerifyGeneratedDiagnostics(string source, params string[] diagnosticsIds) + where TGenerator : class, ISourceGenerator, new() + { + SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); + + IEnumerable references = + from assembly in AppDomain.CurrentDomain.GetAssemblies() + where !assembly.IsDynamic + let reference = MetadataReference.CreateFromFile(assembly.Location) + select reference; + + CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + + ISourceGenerator generator = new TGenerator(); + + CSharpGeneratorDriver driver = CSharpGeneratorDriver.Create(generator); + + driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray diagnostics); + + HashSet resultingIds = diagnostics.Select(diagnostic => diagnostic.Id).ToHashSet(); + + Assert.IsTrue(resultingIds.SetEquals(diagnosticsIds)); + } + } +} \ No newline at end of file diff --git a/tests/ComputeSharp.Tests.Internals/AlignmentHelperTests.cs b/tests/ComputeSharp.Tests.Internals/AlignmentHelperTests.cs new file mode 100644 index 00000000..9886d70c --- /dev/null +++ b/tests/ComputeSharp.Tests.Internals/AlignmentHelperTests.cs @@ -0,0 +1,41 @@ +using ComputeSharp.Core.Helpers; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests.Internals +{ + [TestClass] + [TestCategory("AlignmentHelper")] + public class AlignmentHelperTests + { + [TestMethod] + [DataRow(1, 16, 16)] + [DataRow(2, 16, 16)] + [DataRow(4, 16, 16)] + [DataRow(8, 16, 16)] + [DataRow(16, 16, 16)] + [DataRow(20, 16, 32)] + [DataRow(40, 16, 48)] + public void Pad(int size, int alignment, int expected) + { + int result = AlignmentHelper.Pad(size, alignment); + + Assert.AreEqual(result, expected); + } + + [TestMethod] + [DataRow(0, 4, 16, 0)] + [DataRow(0, 8, 16, 0)] + [DataRow(0, 12, 16, 0)] + [DataRow(0, 16, 16, 0)] + [DataRow(0, 20, 16, 0)] + [DataRow(20, 4, 16, 20)] + [DataRow(20, 16, 16, 32)] + [DataRow(24, 8, 16, 24)] + public void AlignToBoundary(int offset, int size, int alignment, int expected) + { + int result = AlignmentHelper.AlignToBoundary(offset, size, alignment); + + Assert.AreEqual(result, expected); + } + } +} diff --git a/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj b/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj index 518343ba..0f67c513 100644 --- a/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj +++ b/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj @@ -1,19 +1,22 @@  - netcoreapp3.1 - + net5.0 false - - - + + + + diff --git a/tests/ComputeSharp.Tests.Internals/DynamicMethodTests.cs b/tests/ComputeSharp.Tests.Internals/DynamicMethodTests.cs deleted file mode 100644 index a00a7726..00000000 --- a/tests/ComputeSharp.Tests.Internals/DynamicMethodTests.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Reflection.Emit; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests.Internals -{ - [TestClass] - [TestCategory("DynamicMethod")] - public class DynamicMethodTests - { - [TestMethod] - public void TestFunc() - { - Func square = DynamicMethod>.New(il => - { - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Dup); - il.Emit(OpCodes.Mul); - il.Emit(OpCodes.Ret); - }); - - int result = square(2); // result = 2 * 2 - - Assert.IsTrue(result == 4); - } - - public delegate int Square(int x); - - [TestMethod] - public void TestSquare() - { - Square square = DynamicMethod.New(il => - { - il.Emit(OpCodes.Ldarg_0); - il.Emit(OpCodes.Dup); - il.Emit(OpCodes.Mul); - il.Emit(OpCodes.Ret); - }); - - int result = square(2); // result = 2 * 2 - - Assert.IsTrue(result == 4); - } - } -} diff --git a/tests/ComputeSharp.Tests.Internals/ReadableMemberTests.cs b/tests/ComputeSharp.Tests.Internals/ReadableMemberTests.cs deleted file mode 100644 index 396ced28..00000000 --- a/tests/ComputeSharp.Tests.Internals/ReadableMemberTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -using ComputeSharp.Shaders.Translation.Models; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Numerics; -using System.Reflection; - -namespace ComputeSharp.Tests.Internals -{ - /// - /// A container for static fields and properties to test - /// - public sealed class StaticMembersContainer - { - /// - /// A field - /// - public static readonly int Field = 7; - - /// - /// A property - /// - public static int Property { get; } = 44; - } - - [TestClass] - [TestCategory("ReadableMembers")] - public class ReadableMemberTests - { - [TestMethod] - public void PropertyGetter() - { - string text = "Hello world"; - - ReadableMember member = typeof(string).GetProperty(nameof(string.Length)); - - object value = member.GetValue(text); - - Assert.IsTrue((int)value == text.Length); - } - - [TestMethod] - public void FieldGetter() - { - Vector4 vector = new Vector4(7, 0, 0, 0); - - ReadableMember member = typeof(Vector4).GetField(nameof(Vector4.X)); - - object value = member.GetValue(vector); - - Assert.IsTrue((int)(float)value == (int)vector.X); - } - - [TestMethod] - public void StaticFieldGetter() - { - ReadableMember member = typeof(StaticMembersContainer).GetField(nameof(StaticMembersContainer.Field), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); - - object value = member.GetValue(null); - - Assert.IsTrue((int)value == StaticMembersContainer.Field); - } - - [TestMethod] - public void StaticPropertyGetter() - { - ReadableMember member = typeof(StaticMembersContainer).GetProperty(nameof(StaticMembersContainer.Property), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static); - - object value = member.GetValue(null); - - Assert.IsTrue((int)value == StaticMembersContainer.Property); - } - } -} diff --git a/tests/ComputeSharp.Tests.Internals/ShaderCompilerTests.cs b/tests/ComputeSharp.Tests.Internals/ShaderCompilerTests.cs new file mode 100644 index 00000000..cdf75920 --- /dev/null +++ b/tests/ComputeSharp.Tests.Internals/ShaderCompilerTests.cs @@ -0,0 +1,46 @@ +using ComputeSharp.Exceptions; +using ComputeSharp.Shaders.Translation; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using TerraFX.Interop; + +namespace ComputeSharp.Tests.Internals +{ + [TestClass] + [TestCategory("ShaderCompiler")] + public class ShaderCompilerTests + { + private const string ShaderSource = @" + cbuffer _ : register(b0) + { + uint __x; + uint __y; + uint __z; + } + + RWStructuredBuffer buffer : register(u0); + + [NumThreads(32, 1, 1)] + void Execute(uint3 ids : SV_DispatchThreadId) + { + if (ids.x < __x && ids.y < __y && ids.z < __z) + { + buffer[ids.x] *= 2; + } + }"; + + [TestMethod] + public void CompileTest_Ok() + { + using ComPtr dxcBlob = ShaderCompiler.Instance.CompileShader(ShaderSource); + } + + [TestMethod] + [ExpectedException(typeof(HlslCompilationException))] + public void CompileTest_Fail() + { + var faultyShader = ShaderSource.Replace("ids.x", "ids.X"); + + using ComPtr dxcBlob = ShaderCompiler.Instance.CompileShader(faultyShader); + } + } +} diff --git a/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs b/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs new file mode 100644 index 00000000..fb729401 --- /dev/null +++ b/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs @@ -0,0 +1,180 @@ +using ComputeSharp.__Internals; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +#pragma warning disable CS0618 + +namespace ComputeSharp.Tests.Internals +{ + [TestClass] + [TestCategory("ShaderDataLoader")] + public partial class ShaderDataLoaderTests + { + [AutoConstructor] + public partial struct Shader1 : IComputeShader + { + public ReadWriteBuffer _; + + public void Execute() + { + } + } + + [TestMethod] + public unsafe void LoadShader1() + { + ulong* p0 = stackalloc ulong[128]; + byte* p1 = stackalloc byte[256]; + + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + + int size = DispatchDataLoader.LoadDispatchData(Gpu.Default, new Shader1(buffer), ref *p0, ref *p1); + + Assert.AreEqual(12, size); + + Assert.AreEqual(p0[0], buffer.D3D12GpuDescriptorHandle.ptr); + } + + [AutoConstructor] + public partial struct Shader2 : IComputeShader + { + public ReadWriteBuffer _0; + public ReadWriteBuffer _1; + public int a; + public int b; + public int c; + + public void Execute() + { + } + } + + [TestMethod] + public unsafe void LoadShader2() + { + ulong* p0 = stackalloc ulong[128]; + byte* p1 = stackalloc byte[256]; + + using ReadWriteBuffer buffer0 = Gpu.Default.AllocateReadWriteBuffer(16); + using ReadWriteBuffer buffer1 = Gpu.Default.AllocateReadWriteBuffer(16); + + int size = DispatchDataLoader.LoadDispatchData(Gpu.Default, new Shader2(buffer0, buffer1, 1, 22, 77), ref *p0, ref *p1); + + Assert.AreEqual(24, size); + + Assert.AreEqual(p0[0], buffer0.D3D12GpuDescriptorHandle.ptr); + Assert.AreEqual(p0[1], buffer1.D3D12GpuDescriptorHandle.ptr); + + Assert.AreEqual(1, *(int*)&p1[12]); + Assert.AreEqual(22, *(int*)&p1[16]); + Assert.AreEqual(77, *(int*)&p1[20]); + } + + [AutoConstructor] + public partial struct Shader3 : IComputeShader + { + public ReadWriteBuffer _; + public Float3 f3; + public int a; + public int b; + public Double2 d2; + public int c; + public int d; + + public void Execute() + { + } + } + + [TestMethod] + public unsafe void LoadShader3() + { + ulong* p0 = stackalloc ulong[128]; + byte* p1 = stackalloc byte[256]; + + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + + Shader3 shader = new(buffer, new(55, 44, 888), 22, 77, new(3.14, 6.28), 42, 9999); + + int size = DispatchDataLoader.LoadDispatchData(Gpu.Default, in shader, ref *p0, ref *p1); + + Assert.AreEqual(72, size); + + Assert.AreEqual(p0[0], buffer.D3D12GpuDescriptorHandle.ptr); + + Assert.AreEqual(55, *(float*)&p1[16]); + Assert.AreEqual(44, *(float*)&p1[20]); + Assert.AreEqual(888, *(float*)&p1[24]); + Assert.AreEqual(22, *(int*)&p1[28]); + Assert.AreEqual(77, *(int*)&p1[32]); + Assert.AreEqual(3.14, *(double*)&p1[48]); + Assert.AreEqual(6.28, *(double*)&p1[56]); + Assert.AreEqual(42, *(int*)&p1[64]); + Assert.AreEqual(9999, *(int*)&p1[68]); + } + + [AutoConstructor] + public partial struct Shader4 : IComputeShader + { + public ReadWriteBuffer _; + public Float2x3 f2x3; + public int a; + public Int1x3 i1x3; + public Double2 d2; + public int c; + public Int1x2 i1x2; + public Int2x2 i2x2; + public int d; + + public void Execute() + { + } + } + + [TestMethod] + public unsafe void LoadShader4() + { + ulong* p0 = stackalloc ulong[128]; + byte* p1 = stackalloc byte[256]; + + using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(16); + + Shader4 shader = new( + buffer, + f2x3: new(55, 44, 888, 111, 222, 333), + a: 22, + i1x3: new(1, 2, 3), + d2: new(3.14, 6.28), + c: 42, + i1x2: new(111, 222), + i2x2: new(11, 22, 33, 44), + d: 9999); + + int size = DispatchDataLoader.LoadDispatchData(Gpu.Default, in shader, ref *p0, ref *p1); + + Assert.AreEqual(124, size); + + Assert.AreEqual(p0[0], buffer.D3D12GpuDescriptorHandle.ptr); + + Assert.AreEqual(55, *(float*)&p1[16]); + Assert.AreEqual(44, *(float*)&p1[20]); + Assert.AreEqual(888, *(float*)&p1[24]); + Assert.AreEqual(111, *(float*)&p1[32]); + Assert.AreEqual(222, *(float*)&p1[36]); + Assert.AreEqual(333, *(float*)&p1[40]); + Assert.AreEqual(22, *(int*)&p1[44]); + Assert.AreEqual(1, *(int*)&p1[48]); + Assert.AreEqual(2, *(int*)&p1[52]); + Assert.AreEqual(3, *(int*)&p1[56]); + Assert.AreEqual(3.14, *(double*)&p1[64]); + Assert.AreEqual(6.28, *(double*)&p1[72]); + Assert.AreEqual(42, *(int*)&p1[80]); + Assert.AreEqual(111, *(int*)&p1[84]); + Assert.AreEqual(222, *(int*)&p1[88]); + Assert.AreEqual(11, *(int*)&p1[96]); + Assert.AreEqual(22, *(int*)&p1[100]); + Assert.AreEqual(33, *(int*)&p1[112]); + Assert.AreEqual(44, *(int*)&p1[116]); + Assert.AreEqual(9999, *(int*)&p1[120]); + } + } +} diff --git a/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs b/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs index c973bdd0..241ce61b 100644 --- a/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs +++ b/tests/ComputeSharp.Tests.Internals/ShaderHashCodeTests.cs @@ -5,7 +5,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ComputeSharp.Tests.Internals { [TestClass] - [TestCategory("ShaderHashCodes")] + [TestCategory("ShaderHashCode")] public class ShaderHashCodeTests { public struct Shader1 : IComputeShader @@ -13,7 +13,7 @@ namespace ComputeSharp.Tests.Internals public float A; public ReadWriteBuffer B; - public void Execute(ThreadIds ids) + public void Execute() { B[0] = A; } @@ -25,7 +25,7 @@ namespace ComputeSharp.Tests.Internals float value = 10; using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - Shader1 shader1 = new Shader1 { A = value, B = buffer }; + Shader1 shader1 = new() { A = value, B = buffer }; int hash1 = ShaderHashCodeProvider.GetHashCode(shader1), @@ -33,7 +33,7 @@ namespace ComputeSharp.Tests.Internals Assert.IsTrue(hash1 == hash2); - Shader1 shader2 = new Shader1 { A = value, B = buffer }; + Shader1 shader2 = new() { A = value, B = buffer }; int hash3 = ShaderHashCodeProvider.GetHashCode(shader2); @@ -46,7 +46,7 @@ namespace ComputeSharp.Tests.Internals public ReadWriteBuffer B; public Func F; - public void Execute(ThreadIds ids) + public void Execute() { B[0] = F(A); } @@ -55,11 +55,11 @@ namespace ComputeSharp.Tests.Internals [TestMethod] public void ShaderWithCapturedDelegates() { - Func f = x => x * x; + Func f = static x => x * x; using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - Shader2 shader1 = new Shader2 { A = 1, B = buffer, F = f }; + Shader2 shader1 = new() { A = 1, B = buffer, F = f }; int hash1 = ShaderHashCodeProvider.GetHashCode(shader1), @@ -67,9 +67,9 @@ namespace ComputeSharp.Tests.Internals Assert.IsTrue(hash1 == hash2); - f = x => x + 1; + f = static x => x + 1; - Shader2 shader2 = new Shader2 { A = 1, B = buffer, F = f }; + Shader2 shader2 = new() { A = 1, B = buffer, F = f }; int hash3 = ShaderHashCodeProvider.GetHashCode(shader2); diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj b/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj new file mode 100644 index 00000000..48f8466e --- /dev/null +++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj @@ -0,0 +1,18 @@ + + + + net5.0 + false + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs new file mode 100644 index 00000000..4705f20e --- /dev/null +++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs @@ -0,0 +1,290 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.ComponentModel; +using System.Diagnostics; +using System.IO; + +[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.ClassLevel)] + +namespace ComputeSharp.Tests.NativeLibrariesResolver +{ + [TestClass] + public class NativeLibrariesResolverTests + { + /// + /// Performs static initialization for the assembly before any unit tests are run. + /// + /// The for the test runner instance in use. + [AssemblyInitialize] + public static void Initialize(TestContext _) + { + string path = Path.GetDirectoryName(typeof(NativeLibrariesResolverTests).Assembly.Location)!; + + while (Path.GetFileName(path) is not "ComputeSharp") + { + path = Path.GetDirectoryName(path)!; + } + + SampleProjectDirectory = Path.Combine(path, "samples", "ComputeSharp.Sample.NuGet"); + + string packagingProjectPath = Path.Combine(path, "src", "ComputeSharp.Package", "ComputeSharp.Package.msbuildproj"); + + // Run dotnet pack and on the packaging project, to ensure the local NuGet package is available + Process.Start("dotnet", $"pack {packagingProjectPath} -c Release").WaitForExit(); + } + + /// + /// Gets the directory of the ComputeSharp.Sample.NuGet project. + /// + private static string? SampleProjectDirectory { get; set; } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetRunWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, "dotnet", $"run -c {configuration} {ToOption(rid)}")); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningDotnetHostFromProjectDirectoryWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string realtivePathToDll = Path.Combine("bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}", "ComputeSharp.Sample.NuGet.dll"); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, "dotnet", realtivePathToDll)); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningDotnetHostDirectlyWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string pathToDllDirectory = Path.Combine(SampleProjectDirectory!, "bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}"); + + Assert.AreEqual(0, Exec(pathToDllDirectory, "dotnet", "ComputeSharp.Sample.NuGet.dll")); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningAppHostFromProjectDirectoryWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string relativePathToAppHost = Path.Combine("bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}", "ComputeSharp.Sample.NuGet.exe"); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, relativePathToAppHost, "")); + } + + [TestMethod] + [DataRow(Configuration.Debug, RID.None)] + [DataRow(Configuration.Debug, RID.Win_x64)] + [DataRow(Configuration.Release, RID.None)] + [DataRow(Configuration.Release, RID.Win_x64)] + public void DotnetBuildWithRunningAppHostDirectlyWorks(Configuration configuration, RID rid) + { + CleanSampleProject(configuration, rid); + BuildSampleProject(configuration, rid); + + string pathToAppHostDirectory = Path.Combine(SampleProjectDirectory!, "bin", $"{configuration}", "net5.0", $"{ToDirectory(rid)}"); + + Assert.AreEqual(0, Exec(pathToAppHostDirectory, "ComputeSharp.Sample.NuGet.exe", "")); + } + + + [TestMethod] + [DataRow(PublishMode.SelfContained, DeploymentMode.Multiassembly, NativeLibrariesDeploymentMode.NotApplicable)] + [DataRow(PublishMode.FrameworkDependent, DeploymentMode.Multiassembly, NativeLibrariesDeploymentMode.NotApplicable)] + [DataRow(PublishMode.SelfContained, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.CopyToApplicationDirectory)] + [DataRow(PublishMode.SelfContained, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory)] + [DataRow(PublishMode.FrameworkDependent, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.CopyToApplicationDirectory)] + [DataRow(PublishMode.FrameworkDependent, DeploymentMode.SingleFile, NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory)] + public void DotnetPublishWorks(PublishMode publishMode, DeploymentMode deploymentMode, NativeLibrariesDeploymentMode nativeLibsDeploymentMode) + { + // Publishing without specifying a RID is not supported. + // Furthermore, only publishing in Release mode is tested. + CleanSampleProject(Configuration.Release, RID.Win_x64); + + Exec(SampleProjectDirectory!, "dotnet", $"publish -c Release -r win-x64 {ToOption(publishMode)} {ToOption(deploymentMode)} {ToOption(nativeLibsDeploymentMode)} /bl"); + + string pathToAppHost = Path.Combine("bin", $"Release", "net5.0", "win-x64", "publish", "ComputeSharp.Sample.NuGet.exe"); + + Assert.AreEqual(0, Exec(SampleProjectDirectory!, pathToAppHost, "")); + } + + /// + /// Cleans the sample project's artifacts for a specific configuration and target runtime. + /// This method is called at the start of each test method to work around bugs around some up-to-date checks + /// Causing certain targets to not run and effectively corrupting the build output. + /// + /// The configuration for which the output is cleaned. + /// The RID for which the output is cleaned. + private static void CleanSampleProject(Configuration configuration, RID rid) + { + Exec(SampleProjectDirectory!, "dotnet", $"clean -c {configuration} {ToOption(rid)}"); + } + + /// + /// Builds the sample project with a specific configuration and target runtime. + /// + /// The configuration to use to build the project. + /// The RID to use to build the project. + private static void BuildSampleProject(Configuration configuration, RID rid) + { + Exec(SampleProjectDirectory!, "dotnet", $"build -c {configuration} {ToOption(rid)}"); + } + + /// + /// Executes a specified process from the command line and returns the exit code. + /// + /// The working directory to execute the process. + /// The target file path for the process to execute. + /// The arguments to invoke the process. + /// The exit code for the executed process. + private static int Exec(string workingDirectory, string filePath, string arguments) + { + ProcessStartInfo startInfo = new() + { + UseShellExecute = true, + CreateNoWindow = true, + WindowStyle = ProcessWindowStyle.Hidden, + FileName = filePath, + Arguments = arguments, + WorkingDirectory = workingDirectory + }; + + using Process process = Process.Start(startInfo)!; + + process.WaitForExit(); + + return process.ExitCode; + } + + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(RID rid) => rid switch + { + RID.None => "", + RID.Win_x64 => "-r win-x64", + _ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID)) + }; + + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(PublishMode publishMode) => publishMode switch + { + PublishMode.FrameworkDependent => "--self-contained false", + PublishMode.SelfContained => "--self-contained true", + _ => throw new InvalidEnumArgumentException(nameof(publishMode), (int)publishMode, typeof(PublishMode)) + }; + + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(DeploymentMode deploymentMode) => deploymentMode switch + { + DeploymentMode.Multiassembly => "/p:PublishSingleFile=false", + DeploymentMode.SingleFile => "/p:PublishSingleFile=true", + _ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(DeploymentMode)) + }; + + /// + /// Gets a text representation of the command line argument for the given . + /// + /// The input value. + /// A text representation for . + private static string ToOption(NativeLibrariesDeploymentMode deploymentMode) => deploymentMode switch + { + NativeLibrariesDeploymentMode.NotApplicable => "", + NativeLibrariesDeploymentMode.CopyToApplicationDirectory => "/p:IncludeNativeLibrariesForSelfExtract=false", + NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory => "/p:IncludeNativeLibrariesForSelfExtract=true", + _ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(NativeLibrariesDeploymentMode)) + }; + + /// + /// Gets a text representation of the build folder for the given . + /// + /// The input value. + /// A text representation for . + private static string ToDirectory(RID rid) => rid switch + { + RID.None => "", + RID.Win_x64 => "win-x64", + _ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID)) + }; + + /// + /// A build configuration. + /// + public enum Configuration + { + Debug, + Release + } + + /// + /// A runtime identifier. + /// + public enum RID + { + None, + Win_x64 + } + + /// + /// Indicates how should the application carry the framework with itself. + /// + public enum PublishMode + { + FrameworkDependent, + SelfContained + } + + /// + /// Indicates how should the application be packaged. Notably, these tests employ .NET 5 style SingleFile, + /// aka SuperHost. It does not affect native libraries packaging in .NET 5, but may in the future. + /// + public enum DeploymentMode + { + Multiassembly, + SingleFile + } + + /// + /// Indicates the deployment mode for application's native dependencies. + /// Not applicable to multiassembly deployment mode. + /// + public enum NativeLibrariesDeploymentMode + { + NotApplicable, + ExtractToTemporaryDirectory, + CopyToApplicationDirectory + } + } +} diff --git a/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.jpg b/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.jpg new file mode 100644 index 00000000..50e964e2 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.jpg differ diff --git a/tests/ComputeSharp.Tests/Assets/FractalTiling.jpg b/tests/ComputeSharp.Tests/Assets/FractalTiling.jpg new file mode 100644 index 00000000..8926cf69 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/FractalTiling.jpg differ diff --git a/tests/ComputeSharp.Tests/Assets/MengerJourney.jpg b/tests/ComputeSharp.Tests/Assets/MengerJourney.jpg new file mode 100644 index 00000000..ee41ffe1 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/MengerJourney.jpg differ diff --git a/tests/ComputeSharp.Tests/Assets/Octagrams.jpg b/tests/ComputeSharp.Tests/Assets/Octagrams.jpg new file mode 100644 index 00000000..bef5e971 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/Octagrams.jpg differ diff --git a/tests/ComputeSharp.Tests/Assets/ProteanClouds.jpg b/tests/ComputeSharp.Tests/Assets/ProteanClouds.jpg new file mode 100644 index 00000000..9a0d508e Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/ProteanClouds.jpg differ diff --git a/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.jpg b/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.jpg new file mode 100644 index 00000000..fb107ddc Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.jpg differ diff --git a/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs b/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs new file mode 100644 index 00000000..54550319 --- /dev/null +++ b/tests/ComputeSharp.Tests/Attributes/AllDevicesAttribute.cs @@ -0,0 +1,12 @@ +using System; + +namespace ComputeSharp.Tests.Attributes +{ + /// + /// An attribute to use with targeting all supported devices. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public sealed class AllDevicesAttribute : Attribute + { + } +} diff --git a/tests/ComputeSharp.Tests/Attributes/CombinatorialTestMethodAttribute.cs b/tests/ComputeSharp.Tests/Attributes/CombinatorialTestMethodAttribute.cs new file mode 100644 index 00000000..ff68a4aa --- /dev/null +++ b/tests/ComputeSharp.Tests/Attributes/CombinatorialTestMethodAttribute.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using ComputeSharp.Tests.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests.Attributes +{ + /// + /// A custom implementation that also acts as a combinatorial + /// instance. It has dedicated paths for target devices and resource types, and arbitrary inputs for the test methods. + /// + /// + /// Use this attribute in combination with , , + /// or , not other existing MSTest attributes. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public sealed class CombinatorialTestMethodAttribute : TestMethodAttribute, ITestDataSource + { + /// + IEnumerable ITestDataSource.GetData(MethodInfo methodInfo) + { + Device[] devices; + + if (methodInfo.GetCustomAttribute() is not null) + { + devices = Enum.GetValues(); + } + else if (methodInfo.GetCustomAttributes().ToArray() is { Length: > 0 } values) + { + devices = values.Select(static value => value.Device).ToArray(); + } + else + { + devices = Array.Empty(); + } + + Type[] resources = methodInfo.GetCustomAttributes().Select(static value => value.Type).ToArray(); + object[][] data = methodInfo.GetCustomAttributes().Select(static value => value.Data).ToArray(); + + if (devices.Length > 0) + { + foreach (Device device in devices) + { + if (resources.Length > 0) + { + foreach (Type type in resources) + { + if (data.Length == 0) + { + yield return new object[] { device, type }; + } + else + { + foreach (object[] items in data) + { + yield return new object[] { device, type }.Concat(items).ToArray(); + } + } + } + } + else + { + if (data.Length == 0) + { + yield return new object[] { device }; + } + else + { + foreach (object[] items in data) + { + yield return new object[] { device }.Concat(items).ToArray(); + } + } + } + } + } + else if (resources.Length > 0) + { + foreach (Type type in resources) + { + if (data.Length == 0) + { + yield return new object[] { type }; + } + else + { + foreach (object[] items in data) + { + yield return new object[] { type }.Concat(items).ToArray(); + } + } + } + } + else + { + if (data.Length == 0) + { + yield return Array.Empty(); + } + else + { + foreach (object[] items in data) + { + yield return items; + } + } + } + } + + /// + string ITestDataSource.GetDisplayName(MethodInfo methodInfo, object[] data) + { + return $"{methodInfo.Name} ({string.Join(", ", data)})"; + } + } +} diff --git a/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs b/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs new file mode 100644 index 00000000..fa99504e --- /dev/null +++ b/tests/ComputeSharp.Tests/Attributes/DataAttribute.cs @@ -0,0 +1,21 @@ +using System; + +namespace ComputeSharp.Tests.Attributes +{ + /// + /// An attribute to use with adding arbitrary input data. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] + public sealed class DataAttribute : Attribute + { + public DataAttribute(params object[] data) + { + Data = data; + } + + /// + /// Gets the input data for the current attribute. + /// + public object[] Data { get; } + } +} diff --git a/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs b/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs new file mode 100644 index 00000000..ce13a6a1 --- /dev/null +++ b/tests/ComputeSharp.Tests/Attributes/DeviceAttribute.cs @@ -0,0 +1,22 @@ +using System; +using ComputeSharp.Tests.Extensions; + +namespace ComputeSharp.Tests.Attributes +{ + /// + /// An attribute to use with adding a specific input. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public sealed class DeviceAttribute : Attribute + { + public DeviceAttribute(Device device) + { + Device = device; + } + + /// + /// Gets the target to use. + /// + public Device Device { get; } + } +} diff --git a/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs b/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs new file mode 100644 index 00000000..afdff7fd --- /dev/null +++ b/tests/ComputeSharp.Tests/Attributes/ResourceAttribute.cs @@ -0,0 +1,18 @@ +using System; + +namespace ComputeSharp.Tests.Attributes +{ + /// + /// An attribute to use with targeting a specific resource type. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] + public sealed class ResourceAttribute : Attribute + { + public ResourceAttribute(Type type) + { + Type = type; + } + + public Type Type { get; } + } +} diff --git a/tests/ComputeSharp.Tests/BufferTests.cs b/tests/ComputeSharp.Tests/BufferTests.cs index f68f5fa8..b1ffbb42 100644 --- a/tests/ComputeSharp.Tests/BufferTests.cs +++ b/tests/ComputeSharp.Tests/BufferTests.cs @@ -1,148 +1,273 @@ using System; using System.Linq; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ComputeSharp.Tests { [TestClass] - [TestCategory("Buffers")] - public class BufferTests + [TestCategory("Buffer")] + public partial class BufferTests { - [TestMethod] - public void ReadWriteBufferGetSetDataFromArray() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + public void Allocate_Uninitialized_Ok(Device device, Type bufferType) { - float[] array = Enumerable.Range(0, 4096).Select(i => (float)i).ToArray(); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128); - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(array); - float[] result = buffer.GetData(); - - Assert.IsTrue(array.AsSpan().ContentEquals(result)); + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Length, 128); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); } - [TestMethod] - public void ReadOnlyBufferGetSetDataFromArray() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(-247824)] + [Data(-1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int length) { - float[] array = Enumerable.Range(0, 4096).Select(i => (float)i).ToArray(); - - using ConstantBuffer buffer = Gpu.Default.AllocateConstantBuffer(array); - float[] result = buffer.GetData(); - - Assert.IsTrue(array.AsSpan().ContentEquals(result)); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, length); } - [TestMethod] - public void ReadWriteBufferGetSetDataFromReadWriteBuffer() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + public void Allocate_FromArray(Device device, Type bufferType) { - float[] array = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); + float[] data = Enumerable.Range(0, 128).Select(static i => (float)i).ToArray(); - using ReadWriteBuffer sourceBuffer = Gpu.Default.AllocateReadWriteBuffer(array); - using ReadWriteBuffer destinationBuffer = Gpu.Default.AllocateReadWriteBuffer(sourceBuffer); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, data); - float[] sourceResult = sourceBuffer.GetData(); - float[] destinationResult = destinationBuffer.GetData(); + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Length, 128); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); - Assert.IsTrue(array.AsSpan().ContentEquals(sourceResult)); - Assert.IsTrue(array.AsSpan().ContentEquals(destinationResult)); + float[] result = buffer.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result)); } - [TestMethod] - public void ReadWriteBufferGetSetDataFromReadOnlyBuffer() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(typeof(ConstantBuffer<>))] + [Data(typeof(ReadOnlyBuffer<>))] + [Data(typeof(ReadWriteBuffer<>))] + public void Allocate_FromBuffer(Device device, Type sourceType, Type destinationType) { - float[] array = Enumerable.Range(0, 4096).Select(i => (float)i).ToArray(); + float[] data = Enumerable.Range(0, 128).Select(static i => (float)i).ToArray(); - using ConstantBuffer sourceBuffer = Gpu.Default.AllocateConstantBuffer(array); - using ReadWriteBuffer destinationBuffer = Gpu.Default.AllocateReadWriteBuffer(sourceBuffer); + using Buffer source = device.Get().AllocateBuffer(sourceType, data); + using Buffer destination = device.Get().AllocateBuffer(destinationType, source); - float[] sourceResult = sourceBuffer.GetData(); - float[] destinationResult = destinationBuffer.GetData(); + Assert.IsNotNull(destination); + Assert.AreEqual(destination.Length, 128); + Assert.AreSame(destination.GraphicsDevice, device.Get()); - Assert.IsTrue(array.AsSpan().ContentEquals(sourceResult)); - Assert.IsTrue(array.AsSpan().ContentEquals(destinationResult)); + float[] result = destination.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result)); } - [TestMethod] - public void ReadOnlyBufferGetSetDataFromReadWriteBuffer() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type bufferType) { - float[] array = Enumerable.Range(0, 4096).Select(i => (float)i).ToArray(); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, 128); - using ReadWriteBuffer sourceBuffer = Gpu.Default.AllocateReadWriteBuffer(array); - using ConstantBuffer destinationBuffer = Gpu.Default.AllocateConstantBuffer(sourceBuffer); + buffer.Dispose(); - float[] sourceResult = sourceBuffer.GetData(); - float[] destinationResult = destinationBuffer.GetData(); - - Assert.IsTrue(array.AsSpan().ContentEquals(sourceResult)); - Assert.IsTrue(array.AsSpan().ContentEquals(destinationResult)); + _ = buffer.ToArray(); } - [TestMethod] - public void ReadOnlyBufferGetSetDataFromReadOnlyBuffer() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(0, 4096)] + [Data(128, 512)] + [Data(2048, 2048)] + public void CopyTo_RangeToArray_Ok(Device device, Type bufferType, int offset, int count) { - float[] array = Enumerable.Range(0, 4096).Select(i => (float)i).ToArray(); + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - using ConstantBuffer sourceBuffer = Gpu.Default.AllocateConstantBuffer(array); - using ConstantBuffer destinationBuffer = Gpu.Default.AllocateConstantBuffer(sourceBuffer); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - float[] sourceResult = sourceBuffer.GetData(); - float[] destinationResult = destinationBuffer.GetData(); + float[] result = buffer.ToArray(offset, count); - Assert.IsTrue(array.AsSpan().ContentEquals(sourceResult)); - Assert.IsTrue(array.AsSpan().ContentEquals(destinationResult)); + Assert.IsNotNull(result); + Assert.AreEqual(result.Length, count); + Assert.IsTrue(array.AsSpan(offset, count).SequenceEqual(result)); } - [TestMethod] - public void ConstantBufferGetRangeData() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(-1, 128)] + [Data(8192, 128)] + [Data(512, 4096)] + [Data(512, -128)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void CopyTo_RangeToArray_Fail(Device device, Type bufferType, int offset, int count) { - float[] array = Enumerable.Range(0, 4096).Select(i => (float)i).ToArray(); + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - using ConstantBuffer sourceBuffer = Gpu.Default.AllocateConstantBuffer(array); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - float[] sourceResult = sourceBuffer.GetData(128, 100); - - Assert.IsTrue(array.AsSpan(128, 100).ContentEquals(sourceResult)); + _ = buffer.ToArray(offset, count); } - [TestMethod] - public void ConstantBufferSetRangeData() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(0, 0, 4096)] + [Data(512, 0, 2048)] + [Data(0, 512, 2048)] + [Data(127, 1024, 587)] + public void CopyTo_RangeToVoid_Ok(Device device, Type bufferType, int destinationOffset, int bufferOffset, int count) { - float[] array = Enumerable.Range(0, 256).Select(i => (float)i).ToArray(); + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - using ConstantBuffer sourceBuffer = Gpu.Default.AllocateConstantBuffer(array); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - array.AsSpan(56, 100).Clear(); - sourceBuffer.SetData(new float[100], 56, 100); + float[] result = new float[4096]; - float[] sourceResult = sourceBuffer.GetData(); + buffer.CopyTo(result, destinationOffset, bufferOffset, count); - Assert.IsTrue(array.AsSpan().ContentEquals(sourceResult)); + Assert.IsTrue(array.AsSpan(bufferOffset, count).SequenceEqual(result.AsSpan(destinationOffset, count))); } - [TestMethod] - public void ReadWriteBufferGetRangeData() + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ConstantBuffer<>))] + [Resource(typeof(ReadOnlyBuffer<>))] + [Resource(typeof(ReadWriteBuffer<>))] + [Data(0, 0, 8196)] + [Data(-12, 0, 1024)] + [Data(0, -56, 1024)] + [Data(512, 0, 4096)] + [Data(12, 1024, 3600)] + [Data(12, 1024, -2096)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void CopyTo_RangeToVoid_Fail(Device device, Type bufferType, int destinationOffset, int bufferOffset, int count) { - float[] array = Enumerable.Range(0, 4096).Select(i => (float)i).ToArray(); + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); - using ReadWriteBuffer sourceBuffer = Gpu.Default.AllocateReadWriteBuffer(array); + using Buffer buffer = device.Get().AllocateBuffer(bufferType, array); - float[] sourceResult = sourceBuffer.GetData(128, 100); + float[] result = new float[4096]; - Assert.IsTrue(array.AsSpan(128, 100).ContentEquals(sourceResult)); + buffer.CopyTo(result, destinationOffset, bufferOffset, count); } - [TestMethod] - public void ReadWriteBufferSetRangeData() + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ConstantBuffer(Device device) { - float[] array = Enumerable.Range(0, 256).Select(i => (float)i).ToArray(); + int[] data = Enumerable.Range(0, 1024).ToArray(); - using ReadWriteBuffer sourceBuffer = Gpu.Default.AllocateReadWriteBuffer(array); + using ConstantBuffer source = device.Get().AllocateConstantBuffer(data); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); - array.AsSpan(56, 100).Clear(); - sourceBuffer.SetData(new float[100], 56, 100); + device.Get().For(source.Length, new ConstantBufferKernel(source, destination)); - float[] sourceResult = sourceBuffer.GetData(); + int[] result = destination.ToArray(); - Assert.IsTrue(array.AsSpan().ContentEquals(sourceResult)); + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ConstantBufferKernel : IComputeShader + { + public readonly ConstantBuffer source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.X] = source[ThreadIds.X]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadOnlyBuffer(Device device) + { + int[] data = Enumerable.Range(0, 1024).ToArray(); + + using ReadOnlyBuffer source = device.Get().AllocateReadOnlyBuffer(data); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Length, new ReadOnlyBufferKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadOnlyBufferKernel : IComputeShader + { + public readonly ReadOnlyBuffer source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.X] = source[ThreadIds.X]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadWriteBuffer(Device device) + { + int[] data = Enumerable.Range(0, 1024).ToArray(); + + using ReadWriteBuffer source = device.Get().AllocateReadWriteBuffer(data); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Length, new ReadWriteBufferKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadWriteBufferKernel : IComputeShader + { + public readonly ReadWriteBuffer source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.X] = source[ThreadIds.X]; + } } } } diff --git a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj index 518343ba..65816af5 100644 --- a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj +++ b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj @@ -1,19 +1,91 @@  - netcoreapp3.1 - + net5.0 false - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + TextTemplatingFileGenerator + Texture2DTests.Pixels.g.cs + + + TextTemplatingFileGenerator + Texture3DTests.Pixels.g.cs + + + + + + + + + + True + True + Texture2DTests.Pixels.tt + + + True + True + Texture3DTests.Pixels.tt + diff --git a/tests/ComputeSharp.Tests/DispatchTests.cs b/tests/ComputeSharp.Tests/DispatchTests.cs new file mode 100644 index 00000000..a454c2e7 --- /dev/null +++ b/tests/ComputeSharp.Tests/DispatchTests.cs @@ -0,0 +1,157 @@ +using System; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("Dispatch")] + public partial class DispatchTests + { + [CombinatorialTestMethod] + [AllDevices] + public unsafe void Verify_ThreadIds(Device device) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + + device.Get().For(buffer.Width, buffer.Height, buffer.Depth, new ThreadIdsShader(buffer)); + + Int4[,,] data = buffer.ToArray(); + int* value = stackalloc int[4]; + + for (int z = 0; z < 50; z++) + { + for (int x = 0; x < 50; x++) + { + for (int y = 0; y < 50; y++) + { + *(Int4*)value = data[z, y, x]; + + Assert.AreEqual(x, value[0]); + Assert.AreEqual(y, value[1]); + Assert.AreEqual(z, value[2]); + } + } + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 8, 8)] + [Data(8, 0, 8)] + [Data(8, 8, 0)] + [Data(8, -3, 16)] + [Data(-1, -1, -1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Verify_ThreadIds_OutOfRange(Device device, int x, int y, int z) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + + device.Get().For(x, y, z, new ThreadIdsShader(buffer)); + + Assert.Fail(); + } + + [AutoConstructor] + internal readonly partial struct ThreadIdsShader : IComputeShader + { + public readonly ReadWriteTexture3D buffer; + + public void Execute() + { + buffer[ThreadIds.XYZ].XYZ = ThreadIds.XYZ; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public unsafe void Verify_GroupIds(Device device) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + + device.Get().For(buffer.Width, buffer.Height, buffer.Depth, 4, 4, 4, new GroupIdsShader(buffer)); + + Int4[,,] data = buffer.ToArray(); + int* value = stackalloc int[4]; + + for (int z = 0; z < 50; z++) + { + for (int x = 0; x < 50; x++) + { + for (int y = 0; y < 50; y++) + { + *(Int4*)value = data[z, y, x]; + + Assert.AreEqual(x % 4, value[0]); + Assert.AreEqual(y % 4, value[1]); + Assert.AreEqual(z % 4, value[2]); + Assert.AreEqual(value[2] * 4 * 4 + value[1] * 4 + value[0], value[3]); + } + } + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 8, 8)] + [Data(8, 0, 8)] + [Data(8, 8, 0)] + [Data(1025, 8, 8)] + [Data(8, 2000, 8)] + [Data(8, 8, 70)] + [Data(8, -1, 8)] + [Data(8, 15, 16)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Verify_GroupIds_OutOfRange(Device device, int x, int y, int z) + { + using ReadWriteTexture3D buffer = device.Get().AllocateReadWriteTexture3D(50, 50, 50); + + device.Get().For(buffer.Width, buffer.Height, buffer.Depth, x, y, z, new GroupIdsShader(buffer)); + + Assert.Fail(); + } + + [AutoConstructor] + internal readonly partial struct GroupIdsShader : IComputeShader + { + public readonly ReadWriteTexture3D buffer; + + public void Execute() + { + buffer[ThreadIds.XYZ].XYZ = GroupIds.XYZ; + buffer[ThreadIds.XYZ].W = GroupIds.Index; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Verify_GroupSize(Device device) + { + using ReadWriteBuffer buffer = device.Get().AllocateReadWriteBuffer(32); + + device.Get().For(1, 1, 1, 4, 15, 7, new GroupSizeShader(buffer)); + + int[] data = buffer.ToArray(); + + Assert.AreEqual(4, data[0]); + Assert.AreEqual(15, data[1]); + Assert.AreEqual(7, data[2]); + Assert.AreEqual(4 * 15 * 7, data[3]); + } + + [AutoConstructor] + internal readonly partial struct GroupSizeShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + public void Execute() + { + buffer[0] = GroupSize.X; + buffer[1] = GroupSize.Y; + buffer[2] = GroupSize.Z; + buffer[3] = GroupSize.Count; + } + } + } +} diff --git a/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs new file mode 100644 index 00000000..0b4d44c5 --- /dev/null +++ b/tests/ComputeSharp.Tests/Extensions/DeviceExtensions.cs @@ -0,0 +1,80 @@ +using System.Linq; +using Microsoft.Toolkit.Diagnostics; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests.Extensions +{ + /// + /// A helper class for testing APIs. + /// + public static class DeviceExtensions + { + /// + /// The instance for the default discrete device. + /// + private static readonly GraphicsDevice? DiscreteDevice; + + /// + /// The instance for the WARP device. + /// + private static readonly GraphicsDevice WarpDevice; + + /// + /// Initializes and . + /// + static DeviceExtensions() + { + GraphicsDevice defaultDevice = Gpu.Default; + + if (defaultDevice.IsHardwareAccelerated) + { + DiscreteDevice = defaultDevice; + WarpDevice = Gpu.QueryDevices(info => !info.IsHardwareAccelerated).First(); + } + else + { + DiscreteDevice = null; + WarpDevice = defaultDevice; + } + } + + /// + /// Gets a instance matching a specified type. + /// + /// The device to retrieve. + /// The device of the requested type. + /// Thrown when the requested device is not present. + public static GraphicsDevice Get(this Device type) + { + GraphicsDevice? device = type switch + { + Device.Discrete => DiscreteDevice, + Device.Warp => WarpDevice, + _ => ThrowHelper.ThrowArgumentException("Invalid device") + }; + + if (device is null) + { + Assert.Inconclusive(); + } + + return device!; + } + } + + /// + /// Indicates a specific compute device. + /// + public enum Device + { + /// + /// A discrete device. + /// + Discrete, + + /// + /// A WARP device (software fallback). + /// + Warp + } +} diff --git a/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs b/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs new file mode 100644 index 00000000..9cfc05d1 --- /dev/null +++ b/tests/ComputeSharp.Tests/Extensions/GraphicsDeviceExtensions.cs @@ -0,0 +1,295 @@ +using System; +using System.Diagnostics.Contracts; +using ComputeSharp.__Internals; +using ComputeSharp.Resources; + +#pragma warning disable CS0618 + +namespace ComputeSharp.Tests.Extensions +{ + /// + /// A helper class for testing APIs. + /// + public static class GraphicsDeviceExtensions + { + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The length of the buffer to create. + /// A instance of the requested size. + [Pure] + public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, int length) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(length), + _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(length), + _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(length), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// A instance of the requested size. + [Pure] + public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, int width, int height) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ReadOnlyTexture2D<>) => device.AllocateReadOnlyTexture2D(width, height), + _ when type == typeof(ReadWriteTexture2D<>) => device.AllocateReadWriteTexture2D(width, height), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The type of pixels used on the GPU side. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// A instance of the requested size. + [Pure] + public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, int width, int height) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return type switch + { + _ when type == typeof(ReadOnlyTexture2D<,>) => device.AllocateReadOnlyTexture2D(width, height), + _ when type == typeof(ReadWriteTexture2D<,>) => device.AllocateReadWriteTexture2D(width, height), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// A instance of the requested size. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(width, height, depth), + _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(width, height, depth), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The type of pixels used on the GPU side. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// A instance of the requested size. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + return type switch + { + _ when type == typeof(ReadOnlyTexture3D<,>) => device.AllocateReadOnlyTexture3D(width, height, depth), + _ when type == typeof(ReadWriteTexture3D<,>) => device.AllocateReadWriteTexture3D(width, height, depth), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The length of the buffer to create. + /// A instance of the requested size. + [Pure] + public static TransferBuffer AllocateTransferBuffer(this GraphicsDevice device, Type type, int length) + where T : unmanaged + { + return type switch + { + _ when type == typeof(UploadBuffer<>) => device.AllocateUploadBuffer(length), + _ when type == typeof(ReadBackBuffer<>) => device.AllocateReadBackBuffer(length), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// A instance of the requested size. + [Pure] + public static TransferTexture2D AllocateTransferTexture2D(this GraphicsDevice device, Type type, int width, int height) + where T : unmanaged + { + return type switch + { + _ when type == typeof(UploadTexture2D<>) => device.AllocateUploadTexture2D(width, height), + _ when type == typeof(ReadBackTexture2D<>) => device.AllocateReadBackTexture2D(width, height), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// A instance of the requested size. + [Pure] + public static TransferTexture3D AllocateTransferTexture3D(this GraphicsDevice device, Type type, int width, int height, int depth) + where T : unmanaged + { + return type switch + { + _ when type == typeof(UploadTexture3D<>) => device.AllocateUploadTexture3D(width, height, depth), + _ when type == typeof(ReadBackTexture3D<>) => device.AllocateReadBackTexture3D(width, height, depth), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The data to load on the buffer. + /// A instance of the requested type. + [Pure] + public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, T[] data) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(data), + _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(data), + _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(data), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of buffer to allocate. + /// The data to load on the texture. + /// The width of the texture to create. + /// The height of the texture to create. + /// A instance of the requested type. + [Pure] + public static Texture2D AllocateTexture2D(this GraphicsDevice device, Type type, T[] data, int width, int height) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ReadOnlyTexture2D<>) => device.AllocateReadOnlyTexture2D(data, width, height), + _ when type == typeof(ReadWriteTexture2D<>) => device.AllocateReadWriteTexture2D(data, width, height), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of buffer to allocate. + /// The data to load on the texture. + /// The width of the texture to create. + /// The height of the texture to create. + /// The depth of the texture to create. + /// A instance of the requested type. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, T[] data, int width, int height, int depth) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(data, width, height, depth), + _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(data, width, height, depth), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the texture. + /// The target instance to allocate the texture for. + /// The type of texture to allocate. + /// A instance of the requested size. + [Pure] + public static Texture3D AllocateTexture3D(this GraphicsDevice device, Type type, T[,,] data) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ReadOnlyTexture3D<>) => device.AllocateReadOnlyTexture3D(data), + _ when type == typeof(ReadWriteTexture3D<>) => device.AllocateReadWriteTexture3D(data), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + + /// + /// Allocates a new instance of the specified type. + /// + /// The type of items in the buffer. + /// The target instance to allocate the buffer for. + /// The type of buffer to allocate. + /// The data to load on the buffer. + /// A instance of the requested type. + [Pure] + public static Buffer AllocateBuffer(this GraphicsDevice device, Type type, Buffer data) + where T : unmanaged + { + return type switch + { + _ when type == typeof(ConstantBuffer<>) => device.AllocateConstantBuffer(data), + _ when type == typeof(ReadOnlyBuffer<>) => device.AllocateReadOnlyBuffer(data), + _ when type == typeof(ReadWriteBuffer<>) => device.AllocateReadWriteBuffer(data), + _ => throw new ArgumentException($"Invalid type: {type}", nameof(type)) + }; + } + } +} diff --git a/tests/ComputeSharp.Tests/Extensions/SpanExtensions.cs b/tests/ComputeSharp.Tests/Extensions/SpanExtensions.cs deleted file mode 100644 index 8918c7c7..00000000 --- a/tests/ComputeSharp.Tests/Extensions/SpanExtensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Tests.Extensions -{ - /// - /// An helper with methods to process fixed-size buffers - /// - public static class SpanExtensions - { - /// - /// The maximum threshold to validate two values as being equal - /// - private const float FloatThreshold = 0.00001f; - - /// - /// Checks whether or not the two input instances have the same content - /// - /// The first to check - /// The second to check - [Pure] - public static bool ContentEquals(this Span a, Span b) - { - if (a.Length != b.Length) return false; - if (a.Length == 0) return true; - - var l = a.Length; - ref var ra = ref a.GetPinnableReference(); - ref var rb = ref b.GetPinnableReference(); - - for (var i = 0; i < l; i++) - if (Math.Abs(Unsafe.Add(ref ra, i) - Unsafe.Add(ref rb, i)) > FloatThreshold) - return false; - - return true; - } - } -} diff --git a/tests/ComputeSharp.Tests/HlslVectorTypesTests.cs b/tests/ComputeSharp.Tests/HlslVectorTypesTests.cs deleted file mode 100644 index 46dc389e..00000000 --- a/tests/ComputeSharp.Tests/HlslVectorTypesTests.cs +++ /dev/null @@ -1,151 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - [TestClass] - [TestCategory("HlslVectorTypes")] - public class HlslVectorTypesTests - { - private struct SequentialCompilation_Shader_1 : IComputeShader - { - public Float2 F2; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = F2.XY; - } - } - - private struct SequentialCompilation_Shader_2 : IComputeShader - { - public Float2 F2; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[1] = F2.XY; - } - } - - [TestMethod] - public void SequentialCompilation() - { - Float2 f2 = new Float2(1, 2); - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader1 = new SequentialCompilation_Shader_1 { F2 = f2, B = buffer }; - var shader2 = new SequentialCompilation_Shader_2 { F2 = f2, B = buffer }; - - Gpu.Default.For(1, shader1); - Gpu.Default.For(1, shader2); - } - - private struct LocalFloatAssignToFloat2Buffer_Shader : IComputeShader - { - public Float2 F2; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = F2.YX; - } - } - - [TestMethod] - public void LocalFloatAssignToFloat2Buffer() - { - Float2 f2 = new Float2(1, 2); - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new LocalFloatAssignToFloat2Buffer_Shader { F2 = f2, B = buffer }; - - Gpu.Default.For(1, shader); - - Float2[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0].X - f2.Y) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[0].Y - f2.X) < 0.0001f); - } - - private struct Int2Properties_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = 1; - } - } - - [TestMethod] - public void Int2Properties() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new Int2Properties_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - Int2[] result = buffer.GetData(); - - Assert.IsTrue(result[0].X == 1); - } - - private struct LocalBoolAssignToBool2Buffer_Shader : IComputeShader - { - public Bool2 B2; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = B2; - } - } - - [TestMethod] - public void LocalBoolAssignToBool2Buffer() - { - Bool2 b2 = Bool2.TrueY; - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new LocalBoolAssignToBool2Buffer_Shader { B2 = b2, B = buffer }; - - Gpu.Default.For(1, shader); - - Bool2[] result = buffer.GetData(); - - Assert.IsTrue(result[0].X == b2.X); - Assert.IsTrue(result[0].Y == b2.Y); - } - - private struct Bool3Operations_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = Bool3.TrueX; - B[1] = Bool3.True; - B[2].YZ = Bool2.True; - } - } - - [TestMethod] - public void Bool3Operations() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(3); - - var shader = new Bool3Operations_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - Bool3[] result = buffer.GetData(); - - Assert.IsTrue(result[0].X && !result[0].Y && !result[0].Z); - Assert.IsTrue(result[1].X && result[1].Y && result[1].Z); - Assert.IsTrue(!result[2].X && result[2].Y && result[2].Z); - } - } -} diff --git a/tests/ComputeSharp.Tests/ImagingTests.cs b/tests/ComputeSharp.Tests/ImagingTests.cs new file mode 100644 index 00000000..ef68773d --- /dev/null +++ b/tests/ComputeSharp.Tests/ImagingTests.cs @@ -0,0 +1,182 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Text; +using ComputeSharp.BokehBlur.Processors; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Processing; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("Imaging")] + public class ImagingTests + { + [CombinatorialTestMethod] + [AllDevices] + public void BokehBlur(Device device) + { + // Early test to ensure the device is available. This saves time when running the + // unit test if the target device is not available, as we skip the preprocessing. + _ = device.Get(); + + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); + + using var original = Image.Load(Path.Combine(path, "city.jpg")); + using var cpu = original.Clone(c => c.BokehBlur(80, 2, 3)); + using var gpu = original.Clone(c => c.ApplyProcessor(new HlslBokehBlurProcessor(device.Get(), 80, 2))); + + string + expectedPath = Path.Combine(path, "city_bokeh_cpu.jpg"), + actualPath = Path.Combine(path, "city_bokeh_gpu.jpg"); + + cpu.Save(expectedPath); + gpu.Save(actualPath); + + TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.000009f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void GaussianBlur(Device device) + { + _ = device.Get(); + + string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging"); + + using var original = Image.Load(Path.Combine(path, "city.jpg")); + using var cpu = original.Clone(c => c.GaussianBlur(30f)); + using var gpu = original.Clone(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(device.Get(), 90))); + + string + expectedPath = Path.Combine(path, "city_gaussian_cpu.jpg"), + actualPath = Path.Combine(path, "city_gaussian_gpu.jpg"); + + cpu.Save(expectedPath); + gpu.Save(actualPath); + + TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.000003f); + } + + /// + /// An tolerant image comparer type, from ImageSharp. + /// + internal static class TolerantImageComparer + { + /// + /// Asserts that two images are equal. + /// + /// The path to the reference image. + /// The path to the expected image. + /// The allowed difference threshold for the normalized delta. + public static void AssertEqual(string expectedPath, string actualPath, float threshold) + { + using var expected = Image.Load(expectedPath); + using var actual = Image.Load(actualPath); + + if (expected.Size() != actual.Size()) + { + Assert.Fail($"The input images have different sizes: {expected.Size()} and {actual.Size()}"); + } + + if (expected.Frames.Count != actual.Frames.Count || + expected.Frames.Count != 1 || + actual.Frames.Count != 1) + { + Assert.Fail("The two input images must have 1 frame each"); + } + + int width = actual.Width; + + float totalDifference = 0F; + + var differences = new List(20); + + for (int y = 0; y < actual.Height; y++) + { + Span aSpan = expected.GetPixelRowSpan(y); + Span bSpan = actual.GetPixelRowSpan(y); + + for (int x = 0; x < width; x++) + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static int GetManhattanDistanceInRgbaSpace(ref ImageSharpRgba32 a, ref ImageSharpRgba32 b) + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static int Diff(ushort a, ushort b) => Math.Abs(a - b); + + return Diff(a.R, b.R) + Diff(a.G, b.G) + Diff(a.B, b.B) + Diff(a.A, b.A); + } + + int d = GetManhattanDistanceInRgbaSpace(ref aSpan[x], ref bSpan[x]); + + if (d > 0) + { + if (differences.Count < 20) + { + var diff = new PixelDifference(new Point(x, y), aSpan[x], bSpan[x]); + differences.Add(diff); + } + + totalDifference += d; + } + } + } + + float normalizedDifference = totalDifference / (actual.Width * (float)actual.Height); + normalizedDifference /= 4F * 65535F; + + if (normalizedDifference > threshold) + { + StringBuilder builder = new(); + builder.AppendLine($"The input images don't match. Normalized delta: {normalizedDifference}%"); + builder.AppendLine($"First {differences.Count} pixel deltas:"); + + foreach (var delta in differences) + { + builder.AppendLine(delta.ToString()); + } + + Assert.Fail(builder.ToString()); + } + } + + /// + /// A simple model repressenting info about a difference between two pixels. + /// + private readonly struct PixelDifference + { + public PixelDifference(Point position, ImageSharpRgba32 expected, ImageSharpRgba32 actual) + { + this.Position = position; + this.RedDifference = actual.R - expected.R; + this.GreenDifference = actual.G - expected.G; + this.BlueDifference = actual.B - expected.B; + this.AlphaDifference = actual.A - expected.A; + } + + public readonly Point Position; + + public readonly int RedDifference; + + public readonly int GreenDifference; + + public readonly int BlueDifference; + + public readonly int AlphaDifference; + + /// + public override string ToString() + { + return $"[delta({RedDifference},{GreenDifference},{BlueDifference},{AlphaDifference}) @ ({Position.X},{Position.Y})]"; + } + } + } + } +} diff --git a/tests/ComputeSharp.Tests/InitializationTests.cs b/tests/ComputeSharp.Tests/InitializationTests.cs index 1406152f..4149d0af 100644 --- a/tests/ComputeSharp.Tests/InitializationTests.cs +++ b/tests/ComputeSharp.Tests/InitializationTests.cs @@ -1,6 +1,6 @@ using System; using System.Linq; -using ComputeSharp.Graphics; +using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -8,43 +8,82 @@ namespace ComputeSharp.Tests { [TestClass] [TestCategory("Initialization")] - public class InitializationTests + public partial class InitializationTests { [TestMethod] - public void CheckIsSupportedAndGetDefaultDevice() + public void IsSupported() { - if (Gpu.IsSupported) Assert.IsNotNull(Gpu.Default); - else Assert.ThrowsException(() => Gpu.Default); + Assert.IsTrue(Gpu.IsSupported); } - private struct RunShaderOnAllDevicesShader : IComputeShader + [CombinatorialTestMethod] + [AllDevices] + public void DeviceInfo(Device device) { - public ReadWriteBuffer B; + GraphicsDevice gpu = device.Get(); - public void Execute(ThreadIds ids) + Assert.IsTrue(gpu.Luid != default); + Assert.IsTrue(gpu.Name is { Length: > 0 }); + Assert.IsTrue(gpu.ComputeUnits != 0); + Assert.IsTrue(gpu.WavefrontSize != 0); + } + + [TestMethod] + public void DisposeDefault() + { + using var before = Gpu.Default.AllocateReadOnlyBuffer(128); + + Gpu.Default.Dispose(); + + using var after = Gpu.Default.AllocateReadOnlyBuffer(128); + } + + [TestMethod] + public void EnumerateDevices() + { + int i = 0; + + foreach (GraphicsDevice device in Gpu.EnumerateDevices()) { - B[ids.X] = ids.X; + if (i++ == 0) Assert.AreSame(Gpu.Default, device); + + using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(128); + + device.For(128, new SampleShader(buffer)); + + int[] data = buffer.ToArray(); + + Assert.IsTrue(data.SequenceEqual(Enumerable.Range(0, 128))); } } [TestMethod] - public void RunShaderOnAllDevices() + public void QueryDevices() { - foreach (GraphicsDevice gpu in Gpu.EnumerateDevices()) + int i = 0; + + foreach (GraphicsDevice device in Gpu.QueryDevices(info => info.DedicatedMemorySize >= 1024)) { - using (ReadWriteBuffer buffer = gpu.AllocateReadWriteBuffer(100)) - { - var shader = new RunShaderOnAllDevicesShader { B = buffer }; + if (i++ == 0) Assert.AreSame(Gpu.Default, device); - gpu.For(100, shader); + using ReadWriteBuffer buffer = device.AllocateReadWriteBuffer(128); - float[] array = buffer.GetData(); - float[] expected = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); + device.For(128, new SampleShader(buffer)); - Assert.IsTrue(array.AsSpan().ContentEquals(expected)); - } + int[] data = buffer.ToArray(); - gpu.Dispose(); + Assert.IsTrue(data.SequenceEqual(Enumerable.Range(0, 128))); + } + } + + [AutoConstructor] + internal readonly partial struct SampleShader : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + public void Execute() + { + buffer[ThreadIds.X] = ThreadIds.X; } } } diff --git a/tests/ComputeSharp.Tests/InternalStaticMembersTests.cs b/tests/ComputeSharp.Tests/InternalStaticMembersTests.cs deleted file mode 100644 index ea58abc3..00000000 --- a/tests/ComputeSharp.Tests/InternalStaticMembersTests.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Numerics; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - /// - /// A container for static fields to test - /// - internal sealed class StaticMembersContainer - { - /// - /// A field - /// - public static readonly float ReadonlyFloat = MathF.PI; - - /// - /// A field - /// - public static float StaticFloat = MathF.PI; - - /// - /// A field - /// - internal static readonly Vector2 ReadonlyVector2 = new Vector2(3.14f, 7.77f); - - /// - /// A field - /// - internal static Vector2 StaticVector2 = new Vector2(3.14f, 7.77f); - - /// - /// A field - /// - public static ReadOnlyBuffer StaticBuffer = Gpu.Default.AllocateReadOnlyBuffer(new[] { 3.14f, 7.77f }); - } - - [TestClass] - [TestCategory("StaticFields")] - public class InternalStaticMembersTests - { - private struct StaticReadonlyScalarFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMembersContainer.ReadonlyFloat; - } - } - - [TestMethod] - public void StaticReadonlyScalarFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticReadonlyScalarFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticMembersContainer.ReadonlyFloat) < 0.0001f); - } - - private struct StaticScalarFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMembersContainer.StaticFloat; - } - } - - [TestMethod] - public void StaticScalarFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticScalarFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticMembersContainer.StaticFloat) < 0.0001f); - } - - private struct StaticScalarFieldRepeatedAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMembersContainer.StaticFloat + StaticMembersContainer.StaticFloat; - } - } - - [TestMethod] - public void StaticScalarFieldRepeatedAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticScalarFieldRepeatedAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticMembersContainer.StaticFloat * 2) < 0.0001f); - } - - private struct StaticReadonlyVectorFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticMembersContainer.ReadonlyVector2.X; - else B[1] = StaticMembersContainer.ReadonlyVector2.Y; - } - } - - [TestMethod] - public void StaticReadonlyVectorFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticReadonlyVectorFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticMembersContainer.ReadonlyVector2.X) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - StaticMembersContainer.ReadonlyVector2.Y) < 0.0001f); - } - - private struct StaticVectorFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticMembersContainer.StaticVector2.X; - else B[1] = StaticMembersContainer.StaticVector2.Y; - } - } - - [TestMethod] - public void StaticVectorFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticVectorFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticMembersContainer.StaticVector2.X) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - StaticMembersContainer.StaticVector2.Y) < 0.0001f); - } - - private struct StaticReadOnlyBufferFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticMembersContainer.StaticBuffer[0]; - else B[1] = StaticMembersContainer.StaticBuffer[1]; - } - } - - [TestMethod] - public void StaticReadOnlyBufferFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticReadOnlyBufferFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - float[] expected = StaticMembersContainer.StaticBuffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - expected[0]) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - expected[1]) < 0.0001f); - } - } -} diff --git a/tests/ComputeSharp.Tests/IntrinsicTests.cs b/tests/ComputeSharp.Tests/IntrinsicTests.cs deleted file mode 100644 index b240f081..00000000 --- a/tests/ComputeSharp.Tests/IntrinsicTests.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - [TestClass] - [TestCategory("Intrinsics")] - public class IntrinsicTests - { - private struct IntrinsicWithInlineOutParamater_Shader : IComputeShader - { - public float A; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = Hlsl.Sin(A); - B[1] = Hlsl.Cos(A); - Hlsl.SinCos(A, out float sine, out float cosine); - B[2] = sine; - B[3] = cosine; - } - } - - [TestMethod] - public void IntrinsicWithInlineOutParamater() - { - float angle = 80; - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(4); - - var shader = new IntrinsicWithInlineOutParamater_Shader { A = angle, B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - result[2]) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - result[3]) < 0.0001f); - } - - private struct IntrinsicWithInlineOutParamaterAndDiscard_Shader : IComputeShader - { - public float A; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = Hlsl.Sin(A); - Hlsl.SinCos(A, out float sine, out _); - B[1] = sine; - } - } - - [TestMethod] - public void IntrinsicWithInlineOutParamaterAndDiscard() - { - float angle = 80; - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new IntrinsicWithInlineOutParamaterAndDiscard_Shader { A = angle, B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - result[1]) < 0.0001f); - } - - private struct IntrinsicWithOutParamaters_Shader : IComputeShader - { - public float A; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = Hlsl.Sin(A); - B[1] = Hlsl.Cos(A); - Hlsl.SinCos(A, out B[2], out B[3]); - } - } - - [TestMethod] - public void IntrinsicWithOutParamaters() - { - float angle = 80; - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(4); - - var shader = new IntrinsicWithOutParamaters_Shader { A = angle, B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - result[2]) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - result[3]) < 0.0001f); - } - } -} diff --git a/tests/ComputeSharp.Tests/InvalidShaderTests.cs b/tests/ComputeSharp.Tests/InvalidShaderTests.cs deleted file mode 100644 index a1da283e..00000000 --- a/tests/ComputeSharp.Tests/InvalidShaderTests.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Linq; -using ComputeSharp.Exceptions; -using ComputeSharp.Graphics; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - [TestClass] - [TestCategory("InvalidShader")] - public class InvalidShaderTests - { - private struct EmptyShaderCompileError_Shader : IComputeShader - { - public void Execute(ThreadIds ids) { } - } - - [TestMethod] - [ExpectedException(typeof(InvalidOperationException))] - public void EmptyShaderCompileError() - { - var shader = default(EmptyShaderCompileError_Shader); - - Gpu.Default.For(10, shader); - } - - private struct DeviceMismatchException_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = 1; - } - } - - [TestMethod] - [ExpectedException(typeof(GraphicsDeviceMismatchException))] - public void DeviceMismatchException() - { - ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - GraphicsDevice device = Gpu.EnumerateDevices().First(); - - var shader = new DeviceMismatchException_Shader { B = buffer }; - - device.For(1, shader); - } - } -} - diff --git a/tests/ComputeSharp.Tests/ShaderClosureTests.cs b/tests/ComputeSharp.Tests/ShaderClosureTests.cs deleted file mode 100644 index 40573273..00000000 --- a/tests/ComputeSharp.Tests/ShaderClosureTests.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System; -using System.Linq; -using System.Numerics; -using ComputeSharp.Tests.Extensions; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - [TestClass] - [TestCategory("ShaderClosure")] - public class ShaderClosureTests - { - private struct LocalScalarAssignToBuffer_Shader : IComputeShader where T : unmanaged - { - public T Value; - public T Zero; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X % 2 == 0) B[ids.X] = Value; - else B[ids.X] = Zero; - } - } - - private static void LocalScalarAssignToBuffer(T value, Func equals) where T : unmanaged - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(4); - - T zero = default; - - var shader = new LocalScalarAssignToBuffer_Shader - { - Value = value, - Zero = zero, - B = buffer - }; - - Gpu.Default.For(4, shader); - - T[] result = buffer.GetData(); - - Assert.IsTrue(equals(result[0], value)); - Assert.IsFalse(equals(result[1], value)); - Assert.IsTrue(equals(result[2], value)); - Assert.IsFalse(equals(result[3], value)); - } - - [TestMethod] - public void LocalScalarAssignToBuffer() - { - LocalScalarAssignToBuffer(10, (a, b) => a == b); - LocalScalarAssignToBuffer(3.14f, (a, b) => MathF.Abs(a - b) < 0.001f); - LocalScalarAssignToBuffer(6.28, (a, b) => Math.Abs(a - b) < 0.001f); - LocalScalarAssignToBuffer(true, (a, b) => a == b); - } - - private struct ShaderWithBoolType_Shader : IComputeShader - { - public ReadWriteBuffer B; - public ReadWriteBuffer I; - - public void Execute(ThreadIds ids) - { - if (B[ids.X]) I[ids.X] = ids.X + 1; - B[ids.X] = (ids.X % 2) == 0; - } - } - - [TestMethod] - public void ShaderWithBoolType() - { - using ReadWriteBuffer bools = Gpu.Default.AllocateReadWriteBuffer(new Bool[] { true, false, true, true }); - using ReadWriteBuffer ints = Gpu.Default.AllocateReadWriteBuffer(4); - - var shader = new ShaderWithBoolType_Shader { B = bools, I = ints }; - - Gpu.Default.For(4, shader); - - Bool[] boolResults = bools.GetData(); - - Assert.IsTrue(boolResults[0]); - Assert.IsFalse(boolResults[1]); - Assert.IsTrue(boolResults[2]); - Assert.IsFalse(boolResults[3]); - - int[] intResults = ints.GetData(); - - Assert.IsTrue(intResults[0] == 1); - Assert.IsTrue(intResults[1] == 0); - Assert.IsTrue(intResults[2] == 3); - Assert.IsTrue(intResults[3] == 4); - } - - private struct LocalKnownVectorAssignToBuffer_Shader : IComputeShader - { - public Vector4 V4; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = V4.X; - else if (ids.X == 1) B[1] = V4.Y; - else if (ids.X == 2) B[2] = V4.Z; - else if (ids.X == 3) B[3] = V4.W; - } - } - - [TestMethod] - public void LocalKnownVectorAssignToBuffer() - { - Vector4 vector4 = new Vector4(1, 2, 3, 4); - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(4); - - var shader = new LocalKnownVectorAssignToBuffer_Shader { V4 = vector4, B = buffer }; - - Gpu.Default.For(4, shader); - - float[] result = buffer.GetData(); - float[] expected = { 1, 2, 3, 4 }; - - Assert.IsTrue(result.AsSpan().ContentEquals(expected)); - } - - private struct CopyBetweenConstantAndWriteableBuffers_Shader : IComputeShader - { - public ConstantBuffer C; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[ids.X] = C[ids.X]; - } - } - - [TestMethod] - public void CopyBetweenConstantAndWriteableBuffers() - { - float[] source = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); - - using ConstantBuffer input = Gpu.Default.AllocateConstantBuffer(source); - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(source.Length); - - var shader = new CopyBetweenConstantAndWriteableBuffers_Shader { C = input, B = buffer }; - - Gpu.Default.For(source.Length, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(result.AsSpan().ContentEquals(source)); - } - - private struct CopyBetweenReadOnlyAndWriteableBuffers_Shader : IComputeShader - { - public ReadOnlyBuffer IN; - public ReadWriteBuffer OUT; - - public void Execute(ThreadIds ids) - { - OUT[ids.X] = IN[ids.X]; - } - } - - [TestMethod] - public void CopyBetweenReadOnlyAndWriteableBuffers() - { - float[] source = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); - - using ReadOnlyBuffer input = Gpu.Default.AllocateReadOnlyBuffer(source); - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(source.Length); - - var shader = new CopyBetweenReadOnlyAndWriteableBuffers_Shader { IN = input, OUT = buffer }; - - Gpu.Default.For(source.Length, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(result.AsSpan().ContentEquals(source)); - } - - private struct CopyBetweenWriteableBuffers_Shader : IComputeShader - { - public ReadWriteBuffer IN; - public ReadWriteBuffer OUT; - - public void Execute(ThreadIds ids) - { - OUT[ids.X] = IN[ids.X]; - } - } - - [TestMethod] - public void CopyBetweenWriteableBuffers() - { - float[] source = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); - - using ReadWriteBuffer input = Gpu.Default.AllocateReadWriteBuffer(source); - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(source.Length); - - var shader = new CopyBetweenWriteableBuffers_Shader { IN = input, OUT = buffer }; - - Gpu.Default.For(source.Length, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(result.AsSpan().ContentEquals(source)); - } - } -} diff --git a/tests/ComputeSharp.Tests/ShaderCompilerTests.cs b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs new file mode 100644 index 00000000..09faf240 --- /dev/null +++ b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs @@ -0,0 +1,77 @@ +using System.Threading; +using ComputeSharp.Interop; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("ShaderCompiler")] + public partial class ShaderCompilerTests + { + [TestMethod] + public void ReservedKeywords() + { + ReflectionServices.GetShaderInfo(out _); + } + + [AutoConstructor] + public readonly partial struct ReservedKeywords_Kernel : IComputeShader + { + public readonly ReadWriteBuffer row_major; + public readonly float dword; + + public void Execute() + { + float exp = Hlsl.Exp(dword * row_major[ThreadIds.X]); + float log = Hlsl.Log(1 + exp); + + row_major[ThreadIds.X] = log / dword; + } + } + + [TestMethod] + public void SpecialTypeAsReturnType() + { + ReflectionServices.GetShaderInfo(out _); + } + + [AutoConstructor] + public readonly partial struct SpecialTypeAsReturnType_Kernel : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + Float2 Foo(float x) => x; + + public void Execute() + { + static Float3 Bar(float x) => x; + + buffer[ThreadIds.X] = Foo(ThreadIds.X) + Bar(ThreadIds.X).XY; + } + } + + [TestMethod] + public void LocalFunctionInExternalMethods() + { + ReflectionServices.GetShaderInfo(out _); + } + + [AutoConstructor] + public readonly partial struct LocalFunctionInExternalMethods_Kernel : IComputeShader + { + public readonly ReadWriteBuffer buffer; + + Float2 Foo(float x) + { + static Float2 Baz(float y) => y; + + return Baz(x); + } + + public void Execute() + { + buffer[ThreadIds.X] = Foo(ThreadIds.X); + } + } + } +} diff --git a/tests/ComputeSharp.Tests/ShaderDispatchTests.cs b/tests/ComputeSharp.Tests/ShaderDispatchTests.cs deleted file mode 100644 index 8957192c..00000000 --- a/tests/ComputeSharp.Tests/ShaderDispatchTests.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Linq; -using ComputeSharp.Tests.Extensions; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - [TestClass] - [TestCategory("ShaderDispatch")] - public class ShaderDispatch - { - private struct WriteToReadWriteBufferDispatch1D_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[ids.X] = ids.X; - } - } - - [TestMethod] - public void WriteToReadWriteBufferDispatch1D() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(100); - - var shader = new WriteToReadWriteBufferDispatch1D_Shader { B = buffer }; - - Gpu.Default.For(100, shader); - - float[] array = buffer.GetData(); - float[] expected = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); - - Assert.IsTrue(array.AsSpan().ContentEquals(expected)); - } - - [TestMethod] - public void WriteToReadWriteBufferManualDispatch1D() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(100); - - var shader = new WriteToReadWriteBufferDispatch1D_Shader { B = buffer }; - - Gpu.Default.For(100, 1, 1, 64, 1, 1, shader); - - float[] array = buffer.GetData(); - float[] expected = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); - - Assert.IsTrue(array.AsSpan().ContentEquals(expected)); - } - - private struct WriteToReadWriteBufferDispatch2D_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[ids.X + ids.Y * 10] = ids.X + ids.Y * 10; - } - } - - [TestMethod] - public void WriteToReadWriteBufferDispatch2D() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(100); - - var shader = new WriteToReadWriteBufferDispatch2D_Shader { B = buffer }; - - Gpu.Default.For(10, 10, shader); - - float[] array = buffer.GetData(); - float[] expected = Enumerable.Range(0, 100).Select(i => (float)i).ToArray(); - - Assert.IsTrue(array.AsSpan().ContentEquals(expected)); - } - - private struct WriteToReadWriteBufferDispatch3D_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[ids.X + ids.Y * 10 + ids.Z * 100] = ids.X + ids.Y * 10 + ids.Z * 100; - } - } - - [TestMethod] - public void WriteToReadWriteBufferDispatch3D() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1000); - - var shader = new WriteToReadWriteBufferDispatch3D_Shader { B = buffer }; - - Gpu.Default.For(10, 10, 10, shader); - - float[] array = buffer.GetData(); - float[] expected = Enumerable.Range(0, 1000).Select(i => (float)i).ToArray(); - - Assert.IsTrue(array.AsSpan().ContentEquals(expected)); - } - - [TestMethod] - public void WriteToReadWriteBufferManualDispatch3D() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1000); - - var shader = new WriteToReadWriteBufferDispatch3D_Shader { B = buffer }; - - Gpu.Default.For(10, 10, 10, 4, 4, 4, shader); - - float[] array = buffer.GetData(); - float[] expected = Enumerable.Range(0, 1000).Select(i => (float)i).ToArray(); - - Assert.IsTrue(array.AsSpan().ContentEquals(expected)); - } - } -} diff --git a/tests/ComputeSharp.Tests/ShadersTests.cs b/tests/ComputeSharp.Tests/ShadersTests.cs new file mode 100644 index 00000000..703aba93 --- /dev/null +++ b/tests/ComputeSharp.Tests/ShadersTests.cs @@ -0,0 +1,96 @@ +using System; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using ComputeSharp.SwapChain.Shaders; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using SixLabors.ImageSharp; +using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("Shaders")] + public class ShadersTests + { + [CombinatorialTestMethod] + [AllDevices] + public void ColorfulInfinity(Device device) + { + RunAndCompareShader(device, static texture => new ColorfulInfinity(texture, 0), 0.0000193f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void FractalTiling(Device device) + { + RunAndCompareShader(device, static texture => new FractalTiling(texture, 0), 0.0000282f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void MengerJourney(Device device) + { + RunAndCompareShader(device, static texture => new MengerJourney(texture, 0), 0.0000864f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void TwoTiledTruchet(Device device) + { + RunAndCompareShader(device, static texture => new TwoTiledTruchet(texture, 0), 0.00033f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Octagrams(Device device) + { + RunAndCompareShader(device, static texture => new Octagrams(texture, 0), 0.00000586f); + } + + [CombinatorialTestMethod] + [AllDevices] + public void ProteanClouds(Device device) + { + RunAndCompareShader(device, static texture => new ProteanClouds(texture, 0), 0.00000107f); + } + + /// + /// Executes a given test for a specified shader. + /// + /// The type of shader to test. + /// The device to use. + /// A producer to create an instance of the shader to run. + /// The comparison delta. + private static void RunAndCompareShader(Device device, Func, T> factory, float delta) + where T : struct, IComputeShader + { + _ = device.Get(); + + string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", $"{typeof(T).Name}.jpg"); + + IImageInfo imageInfo = Image.Identify(expectedPath); + + using Image image = new(imageInfo.Width, imageInfo.Height); + + using (ReadWriteTexture2D texture = device.Get().AllocateReadWriteTexture2D(imageInfo.Width, imageInfo.Height)) + { + device.Get().For(texture.Width, texture.Height, factory(texture)); + + _ = image.TryGetSinglePixelSpan(out Span span); + + texture.CopyTo(MemoryMarshal.Cast(span)); + } + + string actualPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", $"{typeof(T).Name}.jpg"); + + _ = Directory.CreateDirectory(Path.GetDirectoryName(actualPath)!); + + image.Save(actualPath); + + ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, delta); + } + } +} diff --git a/tests/ComputeSharp.Tests/StaticFieldsTests.cs b/tests/ComputeSharp.Tests/StaticFieldsTests.cs deleted file mode 100644 index e2aeb367..00000000 --- a/tests/ComputeSharp.Tests/StaticFieldsTests.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Numerics; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - /// - /// A container for static fields to test - /// - public sealed class StaticFieldsContainer - { - /// - /// A field - /// - public static readonly float ReadonlyFloat = MathF.PI; - - /// - /// A field - /// - public static float StaticFloat = MathF.PI; - - /// - /// A field - /// - public static readonly Vector2 ReadonlyVector2 = new Vector2(3.14f, 7.77f); - - /// - /// A field - /// - public static Vector2 StaticVector2 = new Vector2(3.14f, 7.77f); - - /// - /// A field - /// - public static ReadOnlyBuffer StaticBuffer = Gpu.Default.AllocateReadOnlyBuffer(new[] { 3.14f, 7.77f }); - } - - [TestClass] - [TestCategory("StaticFields")] - public class StaticFieldsTests - { - private struct StaticReadonlyScalarFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticFieldsContainer.ReadonlyFloat; - } - } - - [TestMethod] - public void StaticReadonlyScalarFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticReadonlyScalarFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticFieldsContainer.ReadonlyFloat) < 0.0001f); - } - - private struct StaticScalarFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticFieldsContainer.StaticFloat; - } - } - - [TestMethod] - public void StaticScalarFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticScalarFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticFieldsContainer.StaticFloat) < 0.0001f); - } - - private struct StaticScalarFieldRepeatedAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticFieldsContainer.StaticFloat + StaticFieldsContainer.StaticFloat; - } - } - - [TestMethod] - public void StaticScalarFieldRepeatedAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticScalarFieldRepeatedAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticFieldsContainer.StaticFloat * 2) < 0.0001f); - } - - private struct StaticReadonlyVectorFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticFieldsContainer.ReadonlyVector2.X; - else B[1] = StaticFieldsContainer.ReadonlyVector2.Y; - } - } - - [TestMethod] - public void StaticReadonlyVectorFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticReadonlyVectorFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticFieldsContainer.ReadonlyVector2.X) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - StaticFieldsContainer.ReadonlyVector2.Y) < 0.0001f); - } - - private struct StaticVectorFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticFieldsContainer.StaticVector2.X; - else B[1] = StaticFieldsContainer.StaticVector2.Y; - } - } - - [TestMethod] - public void StaticVectorFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticVectorFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticFieldsContainer.StaticVector2.X) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - StaticFieldsContainer.StaticVector2.Y) < 0.0001f); - } - - private struct StaticReadOnlyBufferFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticFieldsContainer.StaticBuffer[0]; - else B[1] = StaticFieldsContainer.StaticBuffer[1]; - } - } - - [TestMethod] - public void StaticReadOnlyBufferFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticReadOnlyBufferFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - float[] expected = StaticFieldsContainer.StaticBuffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - expected[0]) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - expected[1]) < 0.0001f); - } - } -} diff --git a/tests/ComputeSharp.Tests/StaticFunctionsTests.cs b/tests/ComputeSharp.Tests/StaticFunctionsTests.cs deleted file mode 100644 index 93b979a5..00000000 --- a/tests/ComputeSharp.Tests/StaticFunctionsTests.cs +++ /dev/null @@ -1,391 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - [TestClass] - [TestCategory("StaticFunctions")] - public class StaticFunctionsTests - { - private struct ExternalStaticFunctionDirect_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMethodsContainer.Square(4); - } - } - - [TestMethod] - public void ExternalStaticFunctionDirect() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new ExternalStaticFunctionDirect_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 16) < 0.0001f); - } - - private struct ExternalStaticFunctionWithAttributesDirect_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMethodsContainer.SquareWithAttributes(4); - } - } - - [TestMethod] - public void ExternalStaticFunctionWithAttributesDirect() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new ExternalStaticFunctionWithAttributesDirect_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 16) < 0.0001f); - } - - private struct FloatToFloatFunc_Shader : IComputeShader - { - public Func F; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = F(3); - } - } - - [TestMethod] - public void FloatToFloatFunc() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new FloatToFloatFunc_Shader - { - F = StaticMethodsContainer.Square, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - [TestMethod] - public void InternalFloatToFloatFunc() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - Func square = StaticMethodsContainer.InternalSquare; - - var shader = new FloatToFloatFunc_Shader - { - F = square, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - [TestMethod] - public void ChangingFuncsFromSameMethod() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new FloatToFloatFunc_Shader - { - F = StaticMethodsContainer.Square, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - - shader.F = StaticMethodsContainer.Negate; - - Gpu.Default.For(1, shader); - - result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] + 3) < 0.0001f); - } - - private struct ChangingFuncsFromExternalMethod_Shader : IComputeShader - { - public Func F; - public ReadWriteBuffer B; - public float I; - - public void Execute(ThreadIds ids) - { - B[0] = F(I); - } - } - - [TestMethod] - public void ChangingFuncsFromExternalMethod() - { - MethodRunner(StaticMethodsContainer.Square, 3, 9); - - MethodRunner(StaticMethodsContainer.Negate, 3, -3); - } - - private void MethodRunner(Func func, float input, float expected) - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new ChangingFuncsFromExternalMethod_Shader - { - F = func, - B = buffer, - I = input - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - expected) < 0.0001f); - } - - public delegate float Squarer(float x); - - private struct CustomStaticDelegate_Shader : IComputeShader - { - public Squarer F; - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = F(3); - } - } - - [TestMethod] - public void CustomStaticDelegate() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - Squarer square = StaticMethodsContainer.Square; - - var shader = new CustomStaticDelegate_Shader - { - F = square, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - [TestMethod] - public void InlineStatelessDelegate() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - Func f = x => x * x; - - var shader = new FloatToFloatFunc_Shader - { - F = f, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - [TestMethod] - public void StatelessLocalFunctionToDelegate() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - float Func(float x) => x * x; - - Func f = Func; - - var shader = new FloatToFloatFunc_Shader - { - F = f, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - [TestMethod] - public void StaticLocalFunction() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - static float f(float x) => x * x; - - var shader = new FloatToFloatFunc_Shader - { - F = f, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - [TestMethod] - public void StatelessLocalFunction() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - float f(float x) => x * x; - - var shader = new FloatToFloatFunc_Shader - { - F = f, - B = buffer - }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - public static float Square(float x) => x * x; - - private struct StaticMethodInSameClass_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = Square(3); - } - } - - [TestMethod] - public void StaticMethodInSameClass() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticMethodInSameClass_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - public static Func SquareFunc { get; } = x => x * x; - - private struct StaticFunctionInSameClass_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = SquareFunc(3); - } - } - - [TestMethod] - public void StaticFunctionInSameClass() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticFunctionInSameClass_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - private struct StaticFunctionInExternalClass_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticPropertiesContainer.SquareFunc(3); - } - } - - [TestMethod] - public void StaticFunctionInExternalClass() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticFunctionInExternalClass_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - private static float Sigmoid(float x) => 1 / (1 + Hlsl.Exp(-x)); - - private struct ReadmeSample_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - int offset = ids.X + ids.Y * 1; - float pow = Hlsl.Pow(B[offset], 2); // 9 - B[offset] = Sigmoid(pow); // 0.9998766 - } - } - - [TestMethod] - public void ReadmeSample() - { - float[] buffer = { 3 }; - using ReadWriteBuffer xBuffer = Gpu.Default.AllocateReadWriteBuffer(buffer); - - var shader = new ReadmeSample_Shader { B = xBuffer }; - - Gpu.Default.For(1, shader); - - float[] result = xBuffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 0.9998766f) < 0.0001f); - } - } -} diff --git a/tests/ComputeSharp.Tests/StaticMethodsTests.cs b/tests/ComputeSharp.Tests/StaticMethodsTests.cs deleted file mode 100644 index ee321748..00000000 --- a/tests/ComputeSharp.Tests/StaticMethodsTests.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - /// - /// A container for static methods to test - /// - public static class StaticMethodsContainer - { - [Pure] - public static float Square(float x) => x * x; - - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [return: NotNull] - public static float SquareWithAttributes(float x) => x * x; - - [Pure] - public static float Negate(float x) => -x; - - [Pure] - internal static float InternalSquare(float x) => x * x; - - [Pure] - public static Float4 Range(float x) => new Float4(x, x + 1, x + 2, x + 3); - - [Pure] - public static int Sum(Float4 x) => (int)(x.X + x.Y + x.Z + x.W); - - public static void Assign(int x, out int y) => y = x; - - public static void ReadAndSquare(ref int x) => x *= x; - } - - [TestClass] - [TestCategory("StaticMethods")] - public class StaticMethodsTests - { - private struct FloatToFloatFunc_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMethodsContainer.Square(3); - } - } - - [TestMethod] - public void FloatToFloatFunc() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new FloatToFloatFunc_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - private struct InternalFloatToFloatFunc_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMethodsContainer.InternalSquare(3); - } - } - - [TestMethod] - public void InternalFloatToFloatFunc() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new InternalFloatToFloatFunc_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - 9) < 0.0001f); - } - - private struct FloatToFloat4Func_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMethodsContainer.Range(3); - } - } - - [TestMethod] - public void FloatToFloat4Func() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new FloatToFloat4Func_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - Float4[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0].X - 3) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[0].Y - 4) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[0].Z - 5) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[0].W - 6) < 0.0001f); - } - - private struct Float4ToIntFunc_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticMethodsContainer.Sum(new Float4(1, 2, 3, 14)); - } - } - - [TestMethod] - public void Float4ToIntFunc() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new Float4ToIntFunc_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - int[] result = buffer.GetData(); - - Assert.IsTrue(result[0] == 20); - } - - private struct IntToOutIntFunc_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - StaticMethodsContainer.Assign(7, out B[0]); - } - } - - [TestMethod] - public void IntToOutIntFunc() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new IntToOutIntFunc_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - int[] result = buffer.GetData(); - - Assert.IsTrue(result[0] == 7); - } - - private struct IntToRefIntFunc_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - StaticMethodsContainer.ReadAndSquare(ref B[0]); - } - } - - [TestMethod] - public void IntToRefIntFunc() - { - int[] data = { 3 }; - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(data); - - var shader = new IntToRefIntFunc_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - buffer.GetData(data); - - Assert.IsTrue(data[0] == 9); - } - } -} - diff --git a/tests/ComputeSharp.Tests/StaticPropertiesTests.cs b/tests/ComputeSharp.Tests/StaticPropertiesTests.cs deleted file mode 100644 index e785b42b..00000000 --- a/tests/ComputeSharp.Tests/StaticPropertiesTests.cs +++ /dev/null @@ -1,224 +0,0 @@ -using System; -using System.Numerics; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.Tests -{ - /// - /// A container for static properties to test - /// - public sealed class StaticPropertiesContainer - { - /// - /// A property - /// - public static float ReadonlyFloat => MathF.PI; - - /// - /// A property - /// - public static float StaticFloat { get; set; } = MathF.PI; - - /// - /// A property - /// - public static Vector2 ReadonlyVector2 { get; } = new Vector2(3.14f, 7.77f); - - /// - /// A property - /// - public static Vector2 StaticVector2 { get; set; } = new Vector2(3.14f, 7.77f); - - /// - /// A property - /// - public static ReadOnlyBuffer StaticBuffer { get; set; } = Gpu.Default.AllocateReadOnlyBuffer(new[] { 3.14f, 7.77f }); - - /// - /// A property - /// - public static Func SquareFunc { get; } = x => x * x; - } - - [TestClass] - [TestCategory("StaticProperties")] - public class StaticPropertiesTests - { - private struct StaticReadonlyScalarPropertyAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticPropertiesContainer.ReadonlyFloat; - } - } - - [TestMethod] - public void StaticReadonlyScalarPropertyAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticReadonlyScalarPropertyAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticPropertiesContainer.ReadonlyFloat) < 0.0001f); - } - - private struct StaticScalarPropertyAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticPropertiesContainer.StaticFloat; - } - } - - [TestMethod] - public void StaticScalarPropertyAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticScalarPropertyAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticPropertiesContainer.StaticFloat) < 0.0001f); - } - - private struct StaticScalarPropertyRepeatedAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = StaticPropertiesContainer.StaticFloat + StaticPropertiesContainer.StaticFloat; - } - } - - [TestMethod] - public void StaticScalarPropertyRepeatedAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticScalarPropertyRepeatedAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticPropertiesContainer.StaticFloat * 2) < 0.0001f); - } - - private struct StaticReadonlyVectorPropertyAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticPropertiesContainer.ReadonlyVector2.X; - else B[1] = StaticPropertiesContainer.ReadonlyVector2.Y; - } - } - - [TestMethod] - public void StaticReadonlyVectorPropertyAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticReadonlyVectorPropertyAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticPropertiesContainer.ReadonlyVector2.X) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - StaticPropertiesContainer.ReadonlyVector2.Y) < 0.0001f); - } - - private struct StaticVectorPropertyAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticPropertiesContainer.StaticVector2.X; - else B[1] = StaticPropertiesContainer.StaticVector2.Y; - } - } - - [TestMethod] - public void StaticVectorPropertyAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticVectorPropertyAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - StaticPropertiesContainer.StaticVector2.X) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - StaticPropertiesContainer.StaticVector2.Y) < 0.0001f); - } - - private struct StaticReadOnlyBufferPropertyAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - if (ids.X == 0) B[0] = StaticPropertiesContainer.StaticBuffer[0]; - else B[1] = StaticPropertiesContainer.StaticBuffer[1]; - } - } - - [TestMethod] - public void StaticReadOnlyBufferPropertyAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(2); - - var shader = new StaticReadOnlyBufferPropertyAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(2, shader); - - float[] result = buffer.GetData(); - float[] expected = StaticPropertiesContainer.StaticBuffer.GetData(); - - Assert.IsTrue(MathF.Abs(result[0] - expected[0]) < 0.0001f); - Assert.IsTrue(MathF.Abs(result[1] - expected[1]) < 0.0001f); - } - - public static int SomeNumber = 7; - - private struct StaticLocalScalarFieldAssignToBuffer_Shader : IComputeShader - { - public ReadWriteBuffer B; - - public void Execute(ThreadIds ids) - { - B[0] = SomeNumber; - } - } - - [TestMethod] - public void StaticLocalScalarFieldAssignToBuffer() - { - using ReadWriteBuffer buffer = Gpu.Default.AllocateReadWriteBuffer(1); - - var shader = new StaticLocalScalarFieldAssignToBuffer_Shader { B = buffer }; - - Gpu.Default.For(1, shader); - - int[] result = buffer.GetData(); - - Assert.IsTrue(result[0] == SomeNumber); - } - } -} diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs new file mode 100644 index 00000000..5eaf8df4 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs @@ -0,0 +1,65 @@ +using System; +using System.Numerics; +using System.Reflection; +using ComputeSharp.__Internals; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +#pragma warning disable CS0618 + +namespace ComputeSharp.Tests +{ + public partial class Texture2DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<,>))] + [Resource(typeof(ReadWriteTexture2D<,>))] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(Float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(Float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(Float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(Float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(Float4))] + public void Allocate_Uninitialized_Pixel_Ok(Device device, Type textureType, Type t, Type tPixel) + { + static void Test(Device device, Type textureType) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + using Texture2D texture = device.Get().AllocateTexture2D(textureType, 128, 128); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + if (textureType == typeof(ReadOnlyTexture2D<,>)) + { + Assert.IsTrue(texture is ReadOnlyTexture2D); + } + else + { + Assert.IsTrue(texture is ReadWriteTexture2D); + } + } + + try + { + new Action(Test).Method.GetGenericMethodDefinition().MakeGenericMethod(t, tPixel).Invoke(null, new object[] { device, textureType }); + } + catch (TargetInvocationException e) when (e.InnerException is not null) + { + throw e.InnerException; + } + } + } +} diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs new file mode 100644 index 00000000..9b9f7295 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs @@ -0,0 +1,256 @@ +using System; +using System.Numerics; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; + +namespace ComputeSharp.Tests +{ + public partial class Texture2DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(Float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(Float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(Float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(Float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(Float4))] + public void Dispatch_NormalizedTexture2D(Device device, Type t, Type tPixel) + { + if (t == typeof(Bgra32) && tPixel == typeof(Vector4)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Bgra32_Vector4(source, destination)); + } + if (t == typeof(Bgra32) && tPixel == typeof(Float4)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Bgra32_Float4(source, destination)); + } + if (t == typeof(R16) && tPixel == typeof(float)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_R16_float(source, destination)); + } + if (t == typeof(R8) && tPixel == typeof(float)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_R8_float(source, destination)); + } + if (t == typeof(Rg16) && tPixel == typeof(Vector2)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rg16_Vector2(source, destination)); + } + if (t == typeof(Rg16) && tPixel == typeof(Float2)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rg16_Float2(source, destination)); + } + if (t == typeof(Rg32) && tPixel == typeof(Vector2)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rg32_Vector2(source, destination)); + } + if (t == typeof(Rg32) && tPixel == typeof(Float2)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rg32_Float2(source, destination)); + } + if (t == typeof(Rgba32) && tPixel == typeof(Vector4)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rgba32_Vector4(source, destination)); + } + if (t == typeof(Rgba32) && tPixel == typeof(Float4)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rgba32_Float4(source, destination)); + } + if (t == typeof(Rgba64) && tPixel == typeof(Vector4)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rgba64_Vector4(source, destination)); + } + if (t == typeof(Rgba64) && tPixel == typeof(Float4)) + { + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(128, 128); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_Rgba64_Float4(source, destination)); + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R16_float : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R8_float : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } + } +} \ No newline at end of file diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.tt b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.tt new file mode 100644 index 00000000..e0de4242 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.tt @@ -0,0 +1,83 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".g.cs"#> +<# +var typesMap = new Dictionary +{ + ["Bgra32"] = new[] { "Vector4", "Float4" }, + ["R16"] = new[] { "float" }, + ["R8"] = new[] { "float" }, + ["Rg16"] = new[] { "Vector2", "Float2" }, + ["Rg32"] = new[] { "Vector2", "Float2" }, + ["Rgba32"] = new[] { "Vector4", "Float4" }, + ["Rgba64"] = new[] { "Vector4", "Float4" } +}; + +IEnumerable<(string T, string TPixel)> EnumerateTypes() +{ + foreach (var pair in typesMap) + foreach (var tPixel in pair.Value) + yield return (pair.Key, tPixel); +} +#> +using System; +using System.Numerics; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; + +namespace ComputeSharp.Tests +{ + public partial class Texture2DTests + { + [CombinatorialTestMethod] + [AllDevices] +<# +foreach (var (t, tPixel) in EnumerateTypes()) +{ +#> + [Data(typeof(<#=t#>), typeof(<#=tPixel#>))] +<# +} +#> + public void Dispatch_NormalizedTexture2D(Device device, Type t, Type tPixel) + { +<# +foreach (var (t, tPixel) in EnumerateTypes()) +{ +#> + if (t == typeof(<#=t#>) && tPixel == typeof(<#=tPixel#>)) + { + using ReadOnlyTexture2D<<#=t#>, <#=tPixel#>> source = device.Get().AllocateReadOnlyTexture2D<<#=t#>, <#=tPixel#>>(128, 128); + using ReadWriteTexture2D<<#=t#>, <#=tPixel#>> destination = device.Get().AllocateReadWriteTexture2D<<#=t#>, <#=tPixel#>>(128, 128); + + device.Get().For(128, 128, new Shader_Unorm_<#=t#>_<#=tPixel#>(source, destination)); + } +<# +} +#> + } +<# + +foreach (var (t, tPixel) in EnumerateTypes()) +{ +#> + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_<#=t#>_<#=tPixel#> : IComputeShader + { + public readonly ReadOnlyTexture2D<<#=t#>, <#=tPixel#>> source; + public readonly ReadWriteTexture2D<<#=t#>, <#=tPixel#>> destination; + + public void Execute() + { + destination[ThreadIds.XY] = (source[ThreadIds.XY] + destination[ThreadIds.XY]) / 2; + } + } +<# +} +#> + } +} \ No newline at end of file diff --git a/tests/ComputeSharp.Tests/Texture2DTests.cs b/tests/ComputeSharp.Tests/Texture2DTests.cs new file mode 100644 index 00000000..a0192a65 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture2DTests.cs @@ -0,0 +1,191 @@ +using System; +using System.Linq; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.Toolkit.HighPerformance.Memory; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("Texture2D")] + public partial class Texture2DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + public void Allocate_Uninitialized_Ok(Device device, Type textureType) + { + using Texture2D texture = device.Get().AllocateTexture2D(textureType, 128, 128); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [Data(128, -14253)] + [Data(128, -1)] + [Data(0, -4314)] + [Data(-14, -53)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height) + { + using Texture2D texture = device.Get().AllocateTexture2D(textureType, width, height); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + public void Allocate_FromArray(Device device, Type textureType) + { + float[] data = Enumerable.Range(0, 128 * 128).Select(static i => (float)i).ToArray(); + + using Texture2D texture = device.Get().AllocateTexture2D(textureType, data, 128, 128); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + float[,] result = texture.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result.Cast())); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type textureType) + { + using Texture2D texture = device.Get().AllocateTexture2D(textureType, 10, 10); + + texture.Dispose(); + + _ = texture.ToArray(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [Data(0, 0, 64, 64)] + [Data(0, 14, 64, 50)] + [Data(14, 0, 50, 64)] + [Data(10, 10, 54, 54)] + [Data(20, 20, 32, 27)] + [Data(60, 0, 4, 64)] + [Data(0, 60, 64, 4)] + [Data(63, 2, 1, 60)] + [Data(2, 63, 60, 1)] + public void GetData_RangeToVoid_Ok(Device device, Type textureType, int x, int y, int width, int height) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Texture2D texture = device.Get().AllocateTexture2D(textureType, array, 64, 64); + + float[] result = new float[width * height]; + + texture.CopyTo(result, x, y, width, height); + + Span2D + expected = new Span2D(array, 64, 64).Slice(y, x, height, width), + data = new(result, height, width); + + CollectionAssert.AreEqual(expected.ToArray(), data.ToArray()); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture2D<>))] + [Resource(typeof(ReadWriteTexture2D<>))] + [Data(0, -1, 50, 50)] + [Data(-1, 0, 50, 50)] + [Data(12, 0, -1, 50)] + [Data(12, 0, 20, -1)] + [Data(12, 20, 20, 50)] + [Data(12, 20, 60, 20)] + [Data(80, 20, 40, 20)] + [Data(0, 80, 40, 20)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void GetData_RangeToVoid_Fail(Device device, Type textureType, int x, int y, int width, int height) + { + float[] array = Enumerable.Range(0, 4096).Select(static i => (float)i).ToArray(); + + using Texture2D texture = device.Get().AllocateTexture2D(textureType, array, 64, 64); + + float[] result = new float[4096]; + + texture.CopyTo(result, x, y, width, height); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadOnlyTexture2D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32).ToArray(); + + using ReadOnlyTexture2D source = device.Get().AllocateReadOnlyTexture2D(data, 32, 32); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Width, source.Height, new ReadOnlyTexture2DKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadOnlyTexture2DKernel : IComputeShader + { + public readonly ReadOnlyTexture2D source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XY]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadWriteTexture2D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32).ToArray(); + + using ReadWriteTexture2D source = device.Get().AllocateReadWriteTexture2D(data, 32, 32); + using ReadWriteTexture2D destination = device.Get().AllocateReadWriteTexture2D(32, 32); + + device.Get().For(source.Width, source.Height, new ReadWriteTexture2DKernel(source, destination)); + + int[] result = new int[data.Length]; + + destination.CopyTo(result); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadWriteTexture2DKernel : IComputeShader + { + public readonly ReadWriteTexture2D source; + public readonly ReadWriteTexture2D destination; + + public void Execute() + { + destination[ThreadIds.XY] = source[ThreadIds.XY]; + } + } + } +} diff --git a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.cs b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.cs new file mode 100644 index 00000000..b2827155 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.cs @@ -0,0 +1,66 @@ +using System; +using System.Numerics; +using System.Reflection; +using ComputeSharp.__Internals; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +#pragma warning disable CS0618 + +namespace ComputeSharp.Tests +{ + public partial class Texture3DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<,>))] + [Resource(typeof(ReadWriteTexture3D<,>))] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(Float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(Float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(Float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(Float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(Float4))] + public void Allocate_Uninitialized_Pixel_Ok(Device device, Type textureType, Type t, Type tPixel) + { + static void Test(Device device, Type textureType) + where T : unmanaged, IUnorm + where TPixel : unmanaged + { + using Texture3D texture = device.Get().AllocateTexture3D(textureType, 128, 128, 2); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 128); + Assert.AreEqual(texture.Height, 128); + Assert.AreEqual(texture.Depth, 2); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + if (textureType == typeof(ReadOnlyTexture3D<,>)) + { + Assert.IsTrue(texture is ReadOnlyTexture3D); + } + else + { + Assert.IsTrue(texture is ReadWriteTexture3D); + } + } + + try + { + new Action(Test).Method.GetGenericMethodDefinition().MakeGenericMethod(t, tPixel).Invoke(null, new object[] { device, textureType }); + } + catch (TargetInvocationException e) when (e.InnerException is not null) + { + throw e.InnerException; + } + } + } +} diff --git a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs new file mode 100644 index 00000000..134a4ef4 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs @@ -0,0 +1,256 @@ +using System; +using System.Numerics; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; + +namespace ComputeSharp.Tests +{ + public partial class Texture3DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Data(typeof(Bgra32), typeof(Vector4))] + [Data(typeof(Bgra32), typeof(Float4))] + [Data(typeof(R16), typeof(float))] + [Data(typeof(R8), typeof(float))] + [Data(typeof(Rg16), typeof(Vector2))] + [Data(typeof(Rg16), typeof(Float2))] + [Data(typeof(Rg32), typeof(Vector2))] + [Data(typeof(Rg32), typeof(Float2))] + [Data(typeof(Rgba32), typeof(Vector4))] + [Data(typeof(Rgba32), typeof(Float4))] + [Data(typeof(Rgba64), typeof(Vector4))] + [Data(typeof(Rgba64), typeof(Float4))] + public void Dispatch_NormalizedTexture3D(Device device, Type t, Type tPixel) + { + if (t == typeof(Bgra32) && tPixel == typeof(Vector4)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Bgra32_Vector4(source, destination)); + } + if (t == typeof(Bgra32) && tPixel == typeof(Float4)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Bgra32_Float4(source, destination)); + } + if (t == typeof(R16) && tPixel == typeof(float)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_R16_float(source, destination)); + } + if (t == typeof(R8) && tPixel == typeof(float)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_R8_float(source, destination)); + } + if (t == typeof(Rg16) && tPixel == typeof(Vector2)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rg16_Vector2(source, destination)); + } + if (t == typeof(Rg16) && tPixel == typeof(Float2)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rg16_Float2(source, destination)); + } + if (t == typeof(Rg32) && tPixel == typeof(Vector2)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rg32_Vector2(source, destination)); + } + if (t == typeof(Rg32) && tPixel == typeof(Float2)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rg32_Float2(source, destination)); + } + if (t == typeof(Rgba32) && tPixel == typeof(Vector4)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba32_Vector4(source, destination)); + } + if (t == typeof(Rgba32) && tPixel == typeof(Float4)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba32_Float4(source, destination)); + } + if (t == typeof(Rgba64) && tPixel == typeof(Vector4)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba64_Vector4(source, destination)); + } + if (t == typeof(Rgba64) && tPixel == typeof(Float4)) + { + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(128, 128, 2); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_Rgba64_Float4(source, destination)); + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R16_float : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_R8_float : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Vector2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Vector4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } + } +} \ No newline at end of file diff --git a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.tt b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.tt new file mode 100644 index 00000000..97dfb563 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.tt @@ -0,0 +1,83 @@ +<#@ template debug="false" hostspecific="false" language="C#" #> +<#@ assembly name="System.Core" #> +<#@ import namespace="System.Linq" #> +<#@ import namespace="System.Text" #> +<#@ import namespace="System.Collections.Generic" #> +<#@ output extension=".g.cs"#> +<# +var typesMap = new Dictionary +{ + ["Bgra32"] = new[] { "Vector4", "Float4" }, + ["R16"] = new[] { "float" }, + ["R8"] = new[] { "float" }, + ["Rg16"] = new[] { "Vector2", "Float2" }, + ["Rg32"] = new[] { "Vector2", "Float2" }, + ["Rgba32"] = new[] { "Vector4", "Float4" }, + ["Rgba64"] = new[] { "Vector4", "Float4" } +}; + +IEnumerable<(string T, string TPixel)> EnumerateTypes() +{ + foreach (var pair in typesMap) + foreach (var tPixel in pair.Value) + yield return (pair.Key, tPixel); +} +#> +using System; +using System.Numerics; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; + +namespace ComputeSharp.Tests +{ + public partial class Texture3DTests + { + [CombinatorialTestMethod] + [AllDevices] +<# +foreach (var (t, tPixel) in EnumerateTypes()) +{ +#> + [Data(typeof(<#=t#>), typeof(<#=tPixel#>))] +<# +} +#> + public void Dispatch_NormalizedTexture3D(Device device, Type t, Type tPixel) + { +<# +foreach (var (t, tPixel) in EnumerateTypes()) +{ +#> + if (t == typeof(<#=t#>) && tPixel == typeof(<#=tPixel#>)) + { + using ReadOnlyTexture3D<<#=t#>, <#=tPixel#>> source = device.Get().AllocateReadOnlyTexture3D<<#=t#>, <#=tPixel#>>(128, 128, 2); + using ReadWriteTexture3D<<#=t#>, <#=tPixel#>> destination = device.Get().AllocateReadWriteTexture3D<<#=t#>, <#=tPixel#>>(128, 128, 2); + + device.Get().For(128, 128, 2, new Shader_Unorm_<#=t#>_<#=tPixel#>(source, destination)); + } +<# +} +#> + } +<# + +foreach (var (t, tPixel) in EnumerateTypes()) +{ +#> + + [AutoConstructor] + internal readonly partial struct Shader_Unorm_<#=t#>_<#=tPixel#> : IComputeShader + { + public readonly ReadOnlyTexture3D<<#=t#>, <#=tPixel#>> source; + public readonly ReadWriteTexture3D<<#=t#>, <#=tPixel#>> destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = (source[ThreadIds.XYZ] + destination[ThreadIds.XYZ]) / 2; + } + } +<# +} +#> + } +} \ No newline at end of file diff --git a/tests/ComputeSharp.Tests/Texture3DTests.cs b/tests/ComputeSharp.Tests/Texture3DTests.cs new file mode 100644 index 00000000..d535bc97 --- /dev/null +++ b/tests/ComputeSharp.Tests/Texture3DTests.cs @@ -0,0 +1,219 @@ +using System; +using System.Linq; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.Toolkit.HighPerformance.Extensions; +using Microsoft.Toolkit.HighPerformance.Memory; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("Texture3D")] + public partial class Texture3DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + public void Allocate_Uninitialized_Ok(Device device, Type textureType) + { + using Texture3D texture = device.Get().AllocateTexture3D(textureType, 64, 64, 12); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, 64); + Assert.AreEqual(texture.Height, 64); + Assert.AreEqual(texture.Depth, 12); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(128, -14253, 4)] + [Data(128, -1, 4)] + [Data(0, -4314, 4)] + [Data(-14, -53, 4)] + [Data(12, 12, -1)] + [Data(2, 4, ushort.MaxValue + 1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type textureType, int width, int height, int depth) + { + using Texture3D texture = device.Get().AllocateTexture3D(textureType, width, height, depth); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(12, 12, 4)] + [Data(2, 12, 4)] + [Data(64, 64, 1)] + [Data(64, 27, 3)] + public void Allocate_FromArray(Device device, Type textureType, int width, int height, int depth) + { + float[] data = Enumerable.Range(0, width * height * depth).Select(static i => (float)i).ToArray(); + + using Texture3D texture = device.Get().AllocateTexture3D(textureType, data, width, height, depth); + + Assert.IsNotNull(texture); + Assert.AreEqual(texture.Width, width); + Assert.AreEqual(texture.Height, height); + Assert.AreEqual(texture.Depth, depth); + Assert.AreSame(texture.GraphicsDevice, device.Get()); + + float[,,] result = texture.ToArray(); + + Assert.IsNotNull(result); + Assert.AreEqual(result.GetLength(0), depth); + Assert.AreEqual(result.GetLength(1), height); + Assert.AreEqual(result.GetLength(2), width); + Assert.AreEqual(data.Length, result.Length); + Assert.IsTrue(data.SequenceEqual(result.Cast())); + + Array.Clear(result, 0, result.Length); + + float[] flat = new float[result.Length]; + + texture.CopyTo(flat); + + CollectionAssert.AreEqual(flat, data); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type textureType) + { + using Texture3D texture = device.Get().AllocateTexture3D(textureType, 10, 10, 4); + + texture.Dispose(); + + _ = texture.ToArray(); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(0, 0, 0, 64, 64, 3)] + [Data(0, 14, 0, 64, 50, 3)] + [Data(0, 14, 1, 64, 50, 2)] + [Data(14, 0, 1, 50, 64, 2)] + [Data(10, 10, 2, 54, 54, 1)] + [Data(20, 20, 0, 32, 27, 3)] + [Data(60, 0, 0, 4, 64, 3)] + [Data(0, 60, 2, 64, 4, 1)] + [Data(63, 2, 0, 1, 60, 2)] + [Data(2, 63, 1, 60, 1, 2)] + public void GetData_RangeToVoid_Ok(Device device, Type textureType, int x, int y, int z, int width, int height, int depth) + { + int[,,] array = new int[3, 64, 64]; + + foreach (var item in array.AsSpan().Enumerate()) + item.Value = item.Index; + + using Texture3D texture = device.Get().AllocateTexture3D(textureType, array); + + int[,,] result = new int[depth, height, width]; + + texture.CopyTo(result.AsSpan(), x, y, z, width, height, depth); + + for (int k = 0; k < depth; k++) + { + Span2D + source = array.AsSpan2D(z + k).Slice(y, x, height, width), + destination = result.AsSpan2D(k); + + CollectionAssert.AreEqual(source.ToArray(), destination.ToArray()); + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(ReadOnlyTexture3D<>))] + [Resource(typeof(ReadWriteTexture3D<>))] + [Data(0, -1, 0, 50, 50, 2)] + [Data(-1, 0, 0, 50, 50, 3)] + [Data(12, 0, 0, -1, 50, 1)] + [Data(12, 0, 0, 20, 50, 0)] + [Data(12, 0, 1, 20, -1, 2)] + [Data(12, 20, 2, 20, 50, 1)] + [Data(12, 20, 0, 60, 20, 3)] + [Data(80, 20, 2, 40, 20, 1)] + [Data(0, 80, 2, 40, 20, 1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void GetData_RangeToVoid_Fail(Device device, Type textureType, int x, int y, int z, int width, int height, int depth) + { + float[] array = Enumerable.Range(0, 64 * 64 * 3).Select(static i => (float)i).ToArray(); + + using Texture3D texture = device.Get().AllocateTexture3D(textureType, array, 64, 64, 3); + + float[] result = new float[array.Length]; + + texture.CopyTo(result, x, y, z, width, height, depth); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadOnlyTexture3D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32 * 3).ToArray(); + + using ReadOnlyTexture3D source = device.Get().AllocateReadOnlyTexture3D(data, 32, 32, 3); + using ReadWriteBuffer destination = device.Get().AllocateReadWriteBuffer(data.Length); + + device.Get().For(source.Width, source.Height, source.Depth, new ReadOnlyTexture3DKernel(source, destination)); + + int[] result = destination.ToArray(); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadOnlyTexture3DKernel : IComputeShader + { + public readonly ReadOnlyTexture3D source; + public readonly ReadWriteBuffer destination; + + public void Execute() + { + destination[ThreadIds.Z * 32 * 32 + ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XYZ]; + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Dispatch_ReadWriteTexture2D(Device device) + { + int[] data = Enumerable.Range(0, 32 * 32 * 3).ToArray(); + + using ReadWriteTexture3D source = device.Get().AllocateReadWriteTexture3D(data, 32, 32, 3); + using ReadWriteTexture3D destination = device.Get().AllocateReadWriteTexture3D(32, 32, 3); + + device.Get().For(source.Width, source.Height, source.Depth, new ReadWriteTexture3DKernel(source, destination)); + + int[] result = new int[data.Length]; + + destination.CopyTo(result); + + CollectionAssert.AreEqual(data, result); + } + + [AutoConstructor] + internal readonly partial struct ReadWriteTexture3DKernel : IComputeShader + { + public readonly ReadWriteTexture3D source; + public readonly ReadWriteTexture3D destination; + + public void Execute() + { + destination[ThreadIds.XYZ] = source[ThreadIds.XYZ]; + } + } + } +} diff --git a/tests/ComputeSharp.Tests/TransferBufferTests.cs b/tests/ComputeSharp.Tests/TransferBufferTests.cs new file mode 100644 index 00000000..d1c478de --- /dev/null +++ b/tests/ComputeSharp.Tests/TransferBufferTests.cs @@ -0,0 +1,137 @@ +using System; +using System.Linq; +using System.Runtime.CompilerServices; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.Toolkit.HighPerformance.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("TransferBuffer")] + public partial class TransferBufferTests + { + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + public unsafe void Allocate_Uninitialized_Ok(Device device, Type bufferType) + { + using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128); + + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Length, 128); + Assert.AreEqual(buffer.Memory.Length, 128); + Assert.AreEqual(buffer.Span.Length, 128); + Assert.IsTrue(Unsafe.AreSame(ref buffer.Memory.Span[0], ref buffer.Span[0])); + Assert.IsTrue(Unsafe.AreSame(ref *(float*)buffer.Memory.Pin().Pointer, ref buffer.Span[0])); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + [Data(-247824)] + [Data(-1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int length) + { + using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, length); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadBuffer<>))] + [Resource(typeof(ReadBackBuffer<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type bufferType) + { + using TransferBuffer buffer = device.Get().AllocateTransferBuffer(bufferType, 128); + + buffer.Dispose(); + + _ = buffer.Span; + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_UploadBuffer_Copy_Full(Device device) + { + using UploadBuffer uploadBuffer = device.Get().AllocateUploadBuffer(4096); + + new Random(42).NextBytes(uploadBuffer.Span.AsBytes()); + + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(uploadBuffer.Length); + + uploadBuffer.CopyTo(readOnlyBuffer); + + int[] result = readOnlyBuffer.ToArray(); + + Assert.AreEqual(uploadBuffer.Length, result.Length); + Assert.IsTrue(uploadBuffer.Span.SequenceEqual(result)); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 4096)] + [Data(128, 0, 2048)] + [Data(0, 128, 2048)] + [Data(97, 33, 512)] + public void Allocate_UploadBuffer_Copy_Range(Device device, int destinationOffset, int bufferOffset, int count) + { + using UploadBuffer uploadBuffer = device.Get().AllocateUploadBuffer(4096); + + new Random(42).NextBytes(uploadBuffer.Span.AsBytes()); + + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(uploadBuffer.Length); + + uploadBuffer.CopyTo(readOnlyBuffer, destinationOffset, bufferOffset, count); + + int[] result = readOnlyBuffer.ToArray(destinationOffset, count); + + Assert.AreEqual(result.Length, count); + Assert.IsTrue(uploadBuffer.Span.Slice(bufferOffset, count).SequenceEqual(result)); + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_ReadBackBuffer_Copy_Full(Device device) + { + int[] source = new int[4096]; + + new Random(42).NextBytes(source.AsSpan().AsBytes()); + + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(source); + using ReadBackBuffer readBackBuffer = device.Get().AllocateReadBackBuffer(readOnlyBuffer.Length); + + readOnlyBuffer.CopyTo(readBackBuffer); + + Assert.AreEqual(source.Length, readBackBuffer.Length); + Assert.IsTrue(source.AsSpan().SequenceEqual(readBackBuffer.Span)); + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 4096)] + [Data(128, 0, 2048)] + [Data(0, 128, 2048)] + [Data(97, 33, 512)] + public void Allocate_ReadBackBuffer_Copy_Range(Device device, int destinationOffset, int bufferOffset, int count) + { + int[] source = new int[4096]; + + new Random(42).NextBytes(source.AsSpan().AsBytes()); + + using ReadOnlyBuffer readOnlyBuffer = device.Get().AllocateReadOnlyBuffer(source); + using ReadBackBuffer readBackBuffer = device.Get().AllocateReadBackBuffer(readOnlyBuffer.Length); + + readOnlyBuffer.CopyTo(readBackBuffer, destinationOffset, bufferOffset, count); + + Assert.AreEqual(source.Length, readBackBuffer.Length); + Assert.IsTrue(source.AsSpan(bufferOffset, count).SequenceEqual(readBackBuffer.Span.Slice(destinationOffset, count))); + } + } +} diff --git a/tests/ComputeSharp.Tests/TransferTexture2DTests.cs b/tests/ComputeSharp.Tests/TransferTexture2DTests.cs new file mode 100644 index 00000000..316962af --- /dev/null +++ b/tests/ComputeSharp.Tests/TransferTexture2DTests.cs @@ -0,0 +1,169 @@ +using System; +using System.Linq; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.Toolkit.HighPerformance.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("TransferTexture2D")] + public partial class TransferTexture2DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + public unsafe void Allocate_Uninitialized_Ok(Device device, Type bufferType) + { + using TransferTexture2D buffer = device.Get().AllocateTransferTexture2D(bufferType, 128, 256); + + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Width, 128); + Assert.AreEqual(buffer.Height, 256); + Assert.AreEqual(buffer.View.Width, 128); + Assert.AreEqual(buffer.View.Height, 256); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + [Data(128, -14253)] + [Data(128, -1)] + [Data(0, -4314)] + [Data(-14, -53)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int width, int height) + { + using TransferTexture2D buffer = device.Get().AllocateTransferTexture2D(bufferType, width, height); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture2D<>))] + [Resource(typeof(ReadBackTexture2D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type bufferType) + { + using TransferTexture2D buffer = device.Get().AllocateTransferTexture2D(bufferType, 32, 32); + + buffer.Dispose(); + + _ = buffer.View; + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_UploadTexture2D_Copy_Full(Device device) + { + using UploadTexture2D uploadTexture2D = device.Get().AllocateUploadTexture2D(256, 256); + + for (int i = 0; i < uploadTexture2D.Height; i++) + { + new Random(i).NextBytes(uploadTexture2D.View.GetRowSpan(i).AsBytes()); + } + + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(uploadTexture2D.Width, uploadTexture2D.Height); + + uploadTexture2D.CopyTo(readOnlyTexture2D); + + int[,] result = readOnlyTexture2D.ToArray(); + + Assert.AreEqual(uploadTexture2D.Width, result.GetLength(1)); + Assert.AreEqual(uploadTexture2D.Height, result.GetLength(0)); + + for (int i = 0; i < uploadTexture2D.Height; i++) + { + Assert.IsTrue(uploadTexture2D.View.GetRowSpan(i).SequenceEqual(result.GetRowSpan(i))); + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 2048, 2048)] + [Data(128, 0, 1813, 2048)] + [Data(0, 128, 2000, 944)] + [Data(97, 33, 512, 794)] + public void Allocate_UploadTexture2D_Copy_Range(Device device, int x, int y, int width, int height) + { + using UploadTexture2D uploadTexture2D = device.Get().AllocateUploadTexture2D(2048, 2048); + + for (int i = 0; i < uploadTexture2D.Height; i++) + { + new Random(i).NextBytes(uploadTexture2D.View.GetRowSpan(i).AsBytes()); + } + + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(uploadTexture2D.Width, uploadTexture2D.Height); + + uploadTexture2D.CopyTo(readOnlyTexture2D, x, y, width, height); + + int[,] result = readOnlyTexture2D.ToArray(); + + for (int i = 0; i < height; i++) + { + Span sourceRow = uploadTexture2D.View.GetRowSpan(i + y).Slice(x, width); + Span destinationRow = result.GetRowSpan(i).Slice(0, width); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_ReadBackTexture2D_Copy_Full(Device device) + { + int[,] source = new int[256, 256]; + + for (int i = 0; i < 256; i++) + { + new Random(42).NextBytes(source.GetRowSpan(i).AsBytes()); + } + + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(source); + using ReadBackTexture2D readBackTexture2D = device.Get().AllocateReadBackTexture2D(256, 256); + + readOnlyTexture2D.CopyTo(readBackTexture2D); + + Assert.AreEqual(readBackTexture2D.Width, 256); + Assert.AreEqual(readBackTexture2D.Height, 256); + + for (int i = 0; i < readBackTexture2D.Height; i++) + { + Assert.IsTrue(readBackTexture2D.View.GetRowSpan(i).SequenceEqual(source.GetRowSpan(i))); + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 2048, 2048)] + [Data(128, 0, 1813, 2048)] + [Data(0, 128, 2000, 944)] + [Data(97, 33, 512, 794)] + public void Allocate_ReadBackTexture2D_Copy_Range(Device device, int x, int y, int width, int height) + { + int[,] source = new int[2048, 2048]; + + for (int i = 0; i < 2048; i++) + { + new Random(42).NextBytes(source.GetRowSpan(i).AsBytes()); + } + + using ReadOnlyTexture2D readOnlyTexture2D = device.Get().AllocateReadOnlyTexture2D(source); + using ReadBackTexture2D readBackTexture2D = device.Get().AllocateReadBackTexture2D(2048, 2048); + + readOnlyTexture2D.CopyTo(readBackTexture2D, x, y, width, height); + + for (int i = 0; i < height; i++) + { + Span sourceRow = source.GetRowSpan(i + y).Slice(x, width); + Span destinationRow = readBackTexture2D.View.GetRowSpan(i).Slice(0, width); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); + } + } + } +} diff --git a/tests/ComputeSharp.Tests/TransferTexture3DTests.cs b/tests/ComputeSharp.Tests/TransferTexture3DTests.cs new file mode 100644 index 00000000..edebcc8e --- /dev/null +++ b/tests/ComputeSharp.Tests/TransferTexture3DTests.cs @@ -0,0 +1,207 @@ +using System; +using System.Linq; +using ComputeSharp.Resources; +using ComputeSharp.Tests.Attributes; +using ComputeSharp.Tests.Extensions; +using Microsoft.Toolkit.HighPerformance.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace ComputeSharp.Tests +{ + [TestClass] + [TestCategory("TransferTexture3D")] + public partial class TransferTexture3DTests + { + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + public unsafe void Allocate_Uninitialized_Ok(Device device, Type bufferType) + { + using TransferTexture3D buffer = device.Get().AllocateTransferTexture3D(bufferType, 128, 256, 32); + + Assert.IsNotNull(buffer); + Assert.AreEqual(buffer.Width, 128); + Assert.AreEqual(buffer.Height, 256); + Assert.AreEqual(buffer.Depth, 32); + Assert.AreEqual(buffer.View.Width, 128); + Assert.AreEqual(buffer.View.Height, 256); + Assert.AreEqual(buffer.View.Depth, 32); + Assert.AreSame(buffer.GraphicsDevice, device.Get()); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + [Data(128, -14253, 4)] + [Data(128, -1, 4)] + [Data(0, -4314, 4)] + [Data(-14, -53, 4)] + [Data(12, 12, -1)] + [Data(2, 4, ushort.MaxValue + 1)] + [ExpectedException(typeof(ArgumentOutOfRangeException))] + public void Allocate_Uninitialized_Fail(Device device, Type bufferType, int width, int height, int depth) + { + using TransferTexture3D buffer = device.Get().AllocateTransferTexture3D(bufferType, width, height, depth); + } + + [CombinatorialTestMethod] + [AllDevices] + [Resource(typeof(UploadTexture3D<>))] + [Resource(typeof(ReadBackTexture3D<>))] + [ExpectedException(typeof(ObjectDisposedException))] + public void UsageAfterDispose(Device device, Type bufferType) + { + using TransferTexture3D buffer = device.Get().AllocateTransferTexture3D(bufferType, 32, 32, 16); + + buffer.Dispose(); + + _ = buffer.View; + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_UploadTexture3D_Copy_Full(Device device) + { + using UploadTexture3D uploadTexture3D = device.Get().AllocateUploadTexture3D(256, 256, 16); + + for (int i = 0; i < uploadTexture3D.Depth; i++) + { + for (int j = 0; j < uploadTexture3D.Height; j++) + { + new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes()); + } + } + + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(uploadTexture3D.Width, uploadTexture3D.Height, uploadTexture3D.Depth); + + uploadTexture3D.CopyTo(readOnlyTexture3D); + + int[,,] result = readOnlyTexture3D.ToArray(); + + Assert.AreEqual(uploadTexture3D.Width, result.GetLength(2)); + Assert.AreEqual(uploadTexture3D.Height, result.GetLength(1)); + Assert.AreEqual(uploadTexture3D.Depth, result.GetLength(0)); + + for (int i = 0; i < uploadTexture3D.Depth; i++) + { + for (int j = 0; j < uploadTexture3D.Height; j++) + { + Span sourceRow = uploadTexture3D.View.GetRowSpan(j, i); + Span destinationRow = result.AsSpan2D(i).GetRowSpan(j); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); + } + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 0, 256, 256, 16)] + [Data(128, 0, 0, 72, 256, 16)] + [Data(0, 128, 0, 189, 67, 8)] + [Data(0, 0, 15, 32, 64, 1)] + [Data(97, 33, 4, 128, 99, 7)] + public void Allocate_UploadTexture3D_Copy_Range(Device device, int x, int y, int z, int width, int height, int depth) + { + using UploadTexture3D uploadTexture3D = device.Get().AllocateUploadTexture3D(256, 256, 16); + + for (int i = 0; i < uploadTexture3D.Depth; i++) + { + for (int j = 0; j < uploadTexture3D.Height; j++) + { + new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes()); + } + } + + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(uploadTexture3D.Width, uploadTexture3D.Height, uploadTexture3D.Depth); + + uploadTexture3D.CopyTo(readOnlyTexture3D, x, y, z, width, height, depth); + + int[,,] result = readOnlyTexture3D.ToArray(); + + for (int i = 0; i < depth; i++) + { + for (int j = 0; j < height; j++) + { + Span sourceRow = uploadTexture3D.View.GetRowSpan(j + y, i + z).Slice(x, width); + Span destinationRow = result.AsSpan2D(i).GetRowSpan(j).Slice(0, width); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); + } + } + } + + [CombinatorialTestMethod] + [AllDevices] + public void Allocate_ReadBackTexture3D_Copy_Full(Device device) + { + int[,,] source = new int[16, 256, 256]; + + for (int i = 0; i < 16; i++) + { + for (int j = 0; j < 256; j++) + { + new Random(i * 5381 + j).NextBytes(source.AsSpan2D(i).GetRowSpan(j).AsBytes()); + } + } + + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(source); + using ReadBackTexture3D readBackTexture3D = device.Get().AllocateReadBackTexture3D(256, 256, 16); + + readOnlyTexture3D.CopyTo(readBackTexture3D); + + Assert.AreEqual(readBackTexture3D.Width, 256); + Assert.AreEqual(readBackTexture3D.Height, 256); + Assert.AreEqual(readBackTexture3D.Depth, 16); + + for (int i = 0; i < readBackTexture3D.Depth; i++) + { + for (int j = 0; j < readBackTexture3D.Height; j++) + { + Span sourceRow = source.AsSpan2D(i).GetRowSpan(j); + Span destinationRow = readBackTexture3D.View.GetRowSpan(j, i); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); + } + } + } + + [CombinatorialTestMethod] + [AllDevices] + [Data(0, 0, 0, 256, 256, 16)] + [Data(128, 0, 0, 72, 256, 16)] + [Data(0, 128, 0, 189, 67, 8)] + [Data(0, 0, 15, 32, 64, 1)] + [Data(97, 33, 4, 128, 99, 7)] + public void Allocate_ReadBackTexture3D_Copy_Range(Device device, int x, int y, int z, int width, int height, int depth) + { + int[,,] source = new int[16, 256, 256]; + + for (int i = 0; i < 16; i++) + { + for (int j = 0; j < 256; j++) + { + new Random(i * 5381 + j).NextBytes(source.AsSpan2D(i).GetRowSpan(j).AsBytes()); + } + } + + using ReadOnlyTexture3D readOnlyTexture3D = device.Get().AllocateReadOnlyTexture3D(source); + using ReadBackTexture3D readBackTexture3D = device.Get().AllocateReadBackTexture3D(256, 256, 16); + + readOnlyTexture3D.CopyTo(readBackTexture3D, x, y, z, width, height, depth); + + for (int i = 0; i < depth; i++) + { + for (int j = 0; j < height; j++) + { + Span sourceRow = source.AsSpan2D(i + z).GetRowSpan(j + y).Slice(x, width); + Span destinationRow = readBackTexture3D.View.GetRowSpan(j, i).Slice(0, width); + + Assert.IsTrue(sourceRow.SequenceEqual(destinationRow)); + } + } + } + } +}