Merge pull request #110 from Sergio0694/feature/default-intrinsics
Default value intrinsics, globals support, syntax changes
このコミットが含まれているのは:
54ファイル変更
+13995
-8649
検索条件に一致するファイルはありません
@@ -13,7 +13,7 @@
|
||||
- [GPU resource types](#gpu-resource-types)
|
||||
- [HLSL vector and matrix types](#hlsl-vector-and-matrix-types)
|
||||
- [HLSL intrinsics](#hlsl-intrinsics)
|
||||
- [Shader constants](#shader-constants)
|
||||
- [Shader constants and globals](#shader-constants-and-globals)
|
||||
- [Dispatch info](#dispatch-info)
|
||||
- [Working with images](#working-with-images)
|
||||
- [Shader metaprogramming](#shader-metaprogramming)
|
||||
@@ -129,6 +129,8 @@ 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 and other common linear algebra operations).
|
||||
|
||||
> **NOTE:** in order to make all the available properties and indexers usable when declaring shader constants and globals (see [Shader constants and globals](#shader-constants-and-globals)), they will return undefined data if used on the CPU instead of throwing an exception, and in this case their behavior is considered undefined. Refer to the XML docs for each API for further info, as properties and operators that are only meant to be used in a shader are clearly marked as undefined behavior if used on the CPU side. The only APIs guaranteed to be usable on the GPU are constructors, static properties and properties to access individual elements (eg. `Float4.X`).
|
||||
|
||||
## 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, 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.
|
||||
@@ -152,11 +154,13 @@ public readonly partial struct SoftmaxActivation : IComputeShader
|
||||
}
|
||||
```
|
||||
|
||||
## Shader constants
|
||||
> **NOTE:** in order to make all the intrinsics usable when declaring shader constants and globals (see [Shader constants and globals](#shader-constants-and-globals)), most intrinsics will just return a default value if used on the CPU instead of throwing an exception, and in this case their behavior is considered undefined. Make sure to only ever use these methods in a shader, as their results will not be correct in other execution contexts.
|
||||
|
||||
One common approach to make shaders easier to modify and experiment with is to separate the parameters being used from the code using them, by defining them as constants. **ComputeSharp** has special handling for this, and will rewrite static readonly properties as static constants in the generated shaders, which are optimized by the compiler for frequent access during execution. The advantage of using constants is that they're directly embedded into a compiled shader, so they don't need to be loaded in memory whenever a shader is dispatched. Constant properties can be of any of the supported HLSL primitive types, including vector and matrix types. Furthermore, the initialization of these constants can also use any of the available HLSL intrinsics. If the same result is being used multiple times while a shader is executed, moving values to a shader constant is a good way to avoid repeatedly computing the same value over and over for each invocation.
|
||||
## Shader constants and globals
|
||||
|
||||
Here is an example of how shader constants can be declared and used:
|
||||
One common approach to make shaders easier to modify and experiment with is to separate the parameters being used from the code using them, by defining them as constants. **ComputeSharp** has special handling for this, and will rewrite static fields as global variables in the generated shaders (marking them as constants if needed), which are optimized by the compiler for frequent access during execution. The advantage of using constants is that they're directly embedded into a compiled shader, so they don't need to be loaded in memory whenever a shader is dispatched. Non constant shader global variables, on the other hand, can make code easier to write as they remove the need to pass multiple values around in each function that is invoked. Static fields can be of any of the supported HLSL primitive types, including vector and matrix types. Furthermore, the initialization of these constants can also use any of the available HLSL intrinsics. If the same result is being used multiple times while a shader is executed, moving values to a shader constant is a good way to avoid repeatedly computing the same value over and over.
|
||||
|
||||
Here is an example of how shader constants and mutable globals can be declared and used:
|
||||
|
||||
```csharp
|
||||
[AutoConstructor]
|
||||
@@ -164,16 +168,25 @@ public readonly partial struct SampleShaderWithConstants : IComputeShader
|
||||
{
|
||||
public readonly ReadWriteBuffer<float> buffer;
|
||||
|
||||
private static float Pi => 3.14f;
|
||||
private static Float2 SinCosPi => new(Hlsl.Sin(Pi), Hlsl.Cos(Pi));
|
||||
private const int iterations = 10;
|
||||
private const float pi = 3.14f;
|
||||
private static readonly Float2 sinCosPi = new(Hlsl.Sin(Pi), Hlsl.Cos(Pi));
|
||||
private static float sum;
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
buffer[ThreadIds.X] = Pi + SinCosPi.X * SinCosPi.Y;
|
||||
for (int i = 0; i < iterations; i++)
|
||||
{
|
||||
sum += pi + sinCosPi.X * sinCosPi.Y;
|
||||
}
|
||||
|
||||
buffer[ThreadIds.X] = sum;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
As shown above, there are two ways to declare a constant value in a shader: either by using `const` in C# (which is perfect for when a value is just a primitive scalar type initialized with a constant expression), or by using `static readonly`. The latter has the advantage that it allows the type to be of a vector and matrix type as well, and the initialization can also use any of the available HLSL intrinsics. Lastly, mutable globals can be declared by just using the `static` modifier, and they can also optionally have an initializer (otherwise their default value will be used).
|
||||
|
||||
## Dispatch info
|
||||
|
||||
As shown in the [Quick start](#quick-start) paragraph, **ComputeSharp** includes a number of special types that allow shaders to access a number of useful dispatch info values, such as the current iteration coordinate or the target dispatch range. Here is a list of all the available types in this category:
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
private const int MaxSteps = 30;
|
||||
private const float MinimumDistance = 0.0009f;
|
||||
private const float normalDistance = 0.0002f;
|
||||
private const float NormalDistance = 0.0002f;
|
||||
private const int Iterations = 7;
|
||||
private const float Scale = 3.0f;
|
||||
private const float FieldOfView = 1.0f;
|
||||
@@ -30,11 +30,11 @@
|
||||
private const float Ambient = 0.32184f;
|
||||
private const float Diffuse = 0.5f;
|
||||
|
||||
private static Float3 LightDir => 1.0f;
|
||||
private static Float3 LightColor => new(1.0f, 1.0f, 0.858824f);
|
||||
private static Float3 LightDir2 => new(1.0f, -1.0f, 1.0f);
|
||||
private static Float3 LightColor2 => new(0, 0.333333f, 1.0f);
|
||||
private static Float3 Offset => new(0.92858f, 0.92858f, 0.32858f);
|
||||
private static readonly Float3 LightDir = 1.0f;
|
||||
private static readonly Float3 LightColor = new(1.0f, 1.0f, 0.858824f);
|
||||
private static readonly Float3 LightDir2 = new(1.0f, -1.0f, 1.0f);
|
||||
private static readonly Float3 LightColor2 = new(0, 0.333333f, 1.0f);
|
||||
private static readonly Float3 Offset = new(0.92858f, 0.92858f, 0.32858f);
|
||||
|
||||
/// <summary>
|
||||
/// Rotates a given <see cref="Float2"/> value by a specified amount.
|
||||
@@ -104,7 +104,7 @@
|
||||
/// </summary>
|
||||
private Float3 getNormal(in Float3 pos)
|
||||
{
|
||||
Float3 e = new(0.0f, normalDistance, 0.0f);
|
||||
Float3 e = new(0.0f, NormalDistance, 0.0f);
|
||||
|
||||
return Hlsl.Normalize(new Float3(
|
||||
DE(pos + e.YXX) - DE(pos - e.YXX),
|
||||
@@ -143,7 +143,7 @@
|
||||
|
||||
float smoothStep = steps + distance / MinimumDistance;
|
||||
float ao = 1.1f - smoothStep / MaxSteps;
|
||||
Float3 normal = getNormal(pos - dir * normalDistance * 3.0f);
|
||||
Float3 normal = getNormal(pos - dir * NormalDistance * 3.0f);
|
||||
Float3 color = 1.0f;
|
||||
Float3 light = GetLight(color, normal);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/// </summary>
|
||||
public readonly float time;
|
||||
|
||||
private static Float3x3 m3 => new Float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f;
|
||||
private static readonly Float3x3 m3 = new Float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f;
|
||||
|
||||
private static Float2x2 Rotate(in float a)
|
||||
{
|
||||
|
||||
@@ -49,6 +49,4 @@ CMPS0041 | ComputeSharp.SourceGenerators.ShaderMethodSourceGenerator | Warning |
|
||||
CMPS0042 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp)
|
||||
CMPS0043 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp)
|
||||
CMPS0044 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp)
|
||||
CMPS0045 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp)
|
||||
CMPS0046 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp)
|
||||
CMPS0047 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp)
|
||||
CMPS0045 | ComputeSharp.IComputeShader | Error | IComputeShaderSourceGenerator, [Documentation](https://github.com/Sergio0694/ComputeSharp)
|
||||
@@ -590,74 +590,26 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid shader constant property type.
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid shader static field type.
|
||||
/// <para>
|
||||
/// Format: <c>"The compute shader of type {0} contains a constant property \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)"</c>.
|
||||
/// Format: <c>"The compute shader of type {0} contains a static field \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)"</c>.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DiagnosticDescriptor InvalidShaderConstantPropertyType = new(
|
||||
public static readonly DiagnosticDescriptor InvalidShaderStaticFieldType = new(
|
||||
id: "CMPS0043",
|
||||
title: "Invalid shader constant property type",
|
||||
messageFormat: "The compute shader of type {0} contains a constant property \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)",
|
||||
title: "Invalid shader static field type",
|
||||
messageFormat: "The compute shader of type {0} contains a static field \"{1}\" of an invalid type {2} (only primitive, vector and matrix types are supported)",
|
||||
category: typeof(IComputeShader).FullName,
|
||||
defaultSeverity: DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: "A type representing a compute shader contains a constant property of a type that is not supported.",
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid shader constant property declaration.
|
||||
/// <para>
|
||||
/// Format: <c>"The compute shader of type {0} contains a constant property \"{1}\" with an invalid declaration (must use a lambda expression)"</c>.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DiagnosticDescriptor InvalidShaderConstantPropertyDeclaration = new(
|
||||
id: "CMPS0044",
|
||||
title: "Invalid shader constant property",
|
||||
messageFormat: "The compute shader of type {0} contains a constant property \"{1}\" with an invalid declaration (must use a lambda expression)",
|
||||
category: typeof(IComputeShader).FullName,
|
||||
defaultSeverity: DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: "A type representing a compute shader contains a constant property with an invalid declaration.",
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid shader constant property declaration.
|
||||
/// <para>
|
||||
/// Format: <c>"The compute shader of type {0} contains a mutable property \"{1}\" (only readonly properties are supported)"</c>.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DiagnosticDescriptor NonReadonlyShaderPropertyDeclaration = new(
|
||||
id: "CMPS0045",
|
||||
title: "Invalid shader constant property",
|
||||
messageFormat: "The compute shader of type {0} contains a mutable property \"{1}\" (only readonly properties are supported)",
|
||||
category: typeof(IComputeShader).FullName,
|
||||
defaultSeverity: DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: "A type representing a compute shader contains a non readonly property declaration.",
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid shader constant property declaration.
|
||||
/// <para>
|
||||
/// Format: <c>"The compute shader of type {0} contains an instance property \"{1}\" (only static properties are supported)"</c>.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public static readonly DiagnosticDescriptor InstanceShaderPropertyDeclaration = new(
|
||||
id: "CMPS0046",
|
||||
title: "Invalid shader constant property",
|
||||
messageFormat: "The compute shader of type {0} contains an instance property \"{1}\" (only static properties are supported)",
|
||||
category: typeof(IComputeShader).FullName,
|
||||
defaultSeverity: DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: "A type representing a compute shader contains an instance property declaration.",
|
||||
description: "A type representing a compute shader contains a static field of a type that is not supported.",
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for an invalid <see cref="DispatchSize"/> usage.
|
||||
/// </summary>
|
||||
public static readonly DiagnosticDescriptor InvalidDispatchSizeUsage = new(
|
||||
id: "CMPS0047",
|
||||
id: "CMPS0044",
|
||||
title: "Invalid DispatchSize usage",
|
||||
messageFormat: "The DispatchSize type can only be used within the main body of a compute shader",
|
||||
category: typeof(IComputeShader).FullName,
|
||||
@@ -665,5 +617,18 @@ namespace ComputeSharp.SourceGenerators.Diagnostics
|
||||
isEnabledByDefault: true,
|
||||
description: "The DispatchSize type can only be used within the main body of a compute shader.",
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="DiagnosticDescriptor"/> for a property declaration.
|
||||
/// </summary>
|
||||
public static readonly DiagnosticDescriptor PropertyDeclaration = new(
|
||||
id: "CMPS0045",
|
||||
title: "Property declaration",
|
||||
messageFormat: "Property declarations cannot be used in a compute shader",
|
||||
category: typeof(IComputeShader).FullName,
|
||||
defaultSeverity: DiagnosticSeverity.Error,
|
||||
isEnabledByDefault: true,
|
||||
description: "Property declarations cannot be used in a compute shader.",
|
||||
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp.SourceGenerators.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// A polyfill type that mirrors some methods from <see cref="System.Runtime.InteropServices.MemoryMarshal"/> on .NET 5.
|
||||
/// </summary>
|
||||
internal static class MemoryMarshal
|
||||
{
|
||||
/// <inheritdoc cref="System.Runtime.InteropServices.MemoryMarshal.GetReference{T}(Span{T})"/>
|
||||
public static ref T GetReference<T>(Span<T> span)
|
||||
{
|
||||
return ref System.Runtime.InteropServices.MemoryMarshal.GetReference(span);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Span{T}"/> from a given reference.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of reference to wrap.</typeparam>
|
||||
/// <param name="value">The target reference.</param>
|
||||
/// <param name="length">The length of the <see cref="Span{T}"/> to create.</param>
|
||||
/// <returns>A new <see cref="Span{T}"/> wrapping <paramref name="value"/>.</returns>
|
||||
public static Span<T> CreateSpan<T>(ref T value, int length) => default;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp.SourceGenerators.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// A polyfill type that mirrors some methods from <see cref="System.Runtime.CompilerServices.RuntimeHelpers"/> on .NET 5.
|
||||
/// </summary>
|
||||
internal static class RuntimeHelpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Allocates some memory tied to the lifetime of a specific type.
|
||||
/// </summary>
|
||||
/// <param name="type">The type to associate the memory to.</param>
|
||||
/// <param name="size">The size in byte of the memory to allocate.</param>
|
||||
/// <returns>A pointer to the allocated memory.</returns>
|
||||
public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) => default;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace ComputeSharp.SourceGenerators.Helpers
|
||||
/// <param name="values">The input sequence of <see cref="string"/> groups.</param>
|
||||
/// <returns>An <see cref="ArrayCreationExpression"/> instance with the described contents.</returns>
|
||||
[Pure]
|
||||
public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<IEnumerable<string>> groups)
|
||||
public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<IEnumerable<string?>> groups)
|
||||
{
|
||||
return
|
||||
ArrayCreationExpression(
|
||||
@@ -55,7 +55,10 @@ namespace ComputeSharp.SourceGenerators.Helpers
|
||||
.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()));
|
||||
group.Select(static item => item is null
|
||||
? LiteralExpression(SyntaxKind.NullLiteralExpression)
|
||||
: LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(item)))
|
||||
.ToArray()))).ToArray()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace ComputeSharp.SourceGenerators
|
||||
IFieldSymbol fieldSymbol in
|
||||
from fieldSymbol in structDeclarationSymbol.GetMembers().OfType<IFieldSymbol>()
|
||||
where fieldSymbol.Type is INamedTypeSymbol { IsStatic: false } &&
|
||||
!fieldSymbol.IsConst
|
||||
!fieldSymbol.IsConst && !fieldSymbol.IsStatic
|
||||
select fieldSymbol)
|
||||
{
|
||||
string typeName = fieldSymbol.Type.GetFullMetadataName();
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace ComputeSharp.SourceGenerators
|
||||
// Only process compute shader types
|
||||
if (!structDeclarationSymbol.Interfaces.Any(static interfaceSymbol => interfaceSymbol.Name == nameof(IComputeShader))) return;
|
||||
|
||||
// Properties are not supported
|
||||
DetectAndReportPropertyDeclarations(context, structDeclarationSymbol);
|
||||
|
||||
// We need to sets to track all discovered custom types and static methods
|
||||
HashSet<INamedTypeSymbol> discoveredTypes = new(SymbolEqualityComparer.Default);
|
||||
Dictionary<IMethodSymbol, MethodDeclarationSyntax> staticMethods = new(SymbolEqualityComparer.Default);
|
||||
@@ -77,7 +80,7 @@ namespace ComputeSharp.SourceGenerators
|
||||
var processedTypes = GetProcessedTypes(discoveredTypes).ToArray();
|
||||
var processedMethods = localFunctions.Concat(staticMethods.Values).Select(static method => method.NormalizeWhitespace().ToFullString()).ToArray();
|
||||
var processedConstants = GetProcessedConstants(constantDefinitions);
|
||||
var staticConstants = GetConstantProperties(context, semanticModel, structDeclaration, structDeclarationSymbol, discoveredTypes, constantDefinitions);
|
||||
var staticFields = GetStaticFields(context, semanticModel, structDeclaration, structDeclarationSymbol, discoveredTypes, constantDefinitions);
|
||||
|
||||
// Create the compilation unit with the source attribute
|
||||
var source =
|
||||
@@ -91,7 +94,7 @@ namespace ComputeSharp.SourceGenerators
|
||||
AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(entryPoint))),
|
||||
AttributeArgument(ArrayExpression(processedMethods)),
|
||||
AttributeArgument(NestedArrayExpression(processedConstants)),
|
||||
AttributeArgument(NestedArrayExpression(staticConstants)),
|
||||
AttributeArgument(NestedArrayExpression(staticFields)),
|
||||
AttributeArgument(NestedArrayExpression(sharedBuffers)))))
|
||||
.WithOpenBracketToken(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.OpenBracketToken, TriviaList()))
|
||||
.WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword))))
|
||||
@@ -174,7 +177,7 @@ namespace ComputeSharp.SourceGenerators
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a sequence of shader static constant properties and their mapped names.
|
||||
/// Gets a sequence of shader static fields and their mapped names.
|
||||
/// </summary>
|
||||
/// <param name="context">The current generator context in use.</param>
|
||||
/// <param name="semanticModel">The <see cref="SemanticModel"/> instance for the type to process.</param>
|
||||
@@ -182,9 +185,9 @@ namespace ComputeSharp.SourceGenerators
|
||||
/// <param name="structDeclarationSymbol">The type symbol for the shader type.</param>
|
||||
/// <param name="discoveredTypes">The collection of currently discovered types.</param>
|
||||
/// <param name="constantDefinitions">The collection of discovered constant definitions.</param>
|
||||
/// <returns>A sequence of static constant properties in <paramref name="structDeclarationSymbol"/>.</returns>
|
||||
/// <returns>A sequence of static constant fields in <paramref name="structDeclarationSymbol"/>.</returns>
|
||||
[Pure]
|
||||
private static IEnumerable<IEnumerable<string>> GetConstantProperties(
|
||||
private static IEnumerable<IEnumerable<string?>> GetStaticFields(
|
||||
GeneratorExecutionContext context,
|
||||
SemanticModel semanticModel,
|
||||
StructDeclarationSyntax structDeclaration,
|
||||
@@ -192,55 +195,47 @@ namespace ComputeSharp.SourceGenerators
|
||||
ICollection<INamedTypeSymbol> discoveredTypes,
|
||||
IDictionary<IFieldSymbol, string> constantDefinitions)
|
||||
{
|
||||
foreach (var propertyDeclaration in structDeclaration.Members.OfType<PropertyDeclarationSyntax>())
|
||||
foreach (var fieldDeclaration in structDeclaration.Members.OfType<FieldDeclarationSyntax>())
|
||||
{
|
||||
IPropertySymbol propertySymbol = semanticModel.GetDeclaredSymbol(propertyDeclaration)!;
|
||||
|
||||
if (!propertySymbol.IsStatic)
|
||||
foreach (var variableDeclarator in fieldDeclaration.Declaration.Variables)
|
||||
{
|
||||
context.ReportDiagnostic(InstanceShaderPropertyDeclaration, propertyDeclaration, structDeclarationSymbol, propertySymbol.Name);
|
||||
IFieldSymbol fieldSymbol = (IFieldSymbol)semanticModel.GetDeclaredSymbol(variableDeclarator)!;
|
||||
|
||||
continue;
|
||||
}
|
||||
if (!fieldSymbol.IsStatic || fieldSymbol.IsConst)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!propertySymbol.IsReadOnly)
|
||||
{
|
||||
context.ReportDiagnostic(NonReadonlyShaderPropertyDeclaration, propertyDeclaration, structDeclarationSymbol, propertySymbol.Name);
|
||||
AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass is { Name: nameof(GroupSharedAttribute) });
|
||||
|
||||
continue;
|
||||
}
|
||||
if (attribute is not null) continue;
|
||||
|
||||
// Constant properties must be named type symbols
|
||||
if (propertySymbol.Type is not INamedTypeSymbol typeSymbol)
|
||||
{
|
||||
context.ReportDiagnostic(InvalidShaderConstantPropertyType, propertyDeclaration, structDeclarationSymbol, propertySymbol.Name, propertySymbol.Type);
|
||||
// Constant properties must be of a primitive, vector or matrix type
|
||||
if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol ||
|
||||
!HlslKnownTypes.IsKnownHlslType(typeSymbol.GetFullMetadataName()))
|
||||
{
|
||||
context.ReportDiagnostic(InvalidShaderStaticFieldType, variableDeclarator, structDeclarationSymbol, fieldSymbol.Name, fieldSymbol.Type);
|
||||
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
string metadataName = typeSymbol.GetFullMetadataName();
|
||||
_ = HlslKnownKeywords.TryGetMappedName(fieldSymbol.Name, out string? mapping);
|
||||
|
||||
// Constant properties must be of a primitive, vector or matrix type
|
||||
if (!HlslKnownTypes.IsKnownHlslType(metadataName))
|
||||
{
|
||||
context.ReportDiagnostic(InvalidShaderConstantPropertyType, propertyDeclaration, structDeclarationSymbol, propertySymbol.Name, propertySymbol.Type);
|
||||
string typeDeclaration = fieldSymbol.IsReadOnly switch
|
||||
{
|
||||
true => $"static const {HlslKnownTypes.GetMappedName(typeSymbol)}",
|
||||
false => $"static {HlslKnownTypes.GetMappedName(typeSymbol)}"
|
||||
};
|
||||
|
||||
continue;
|
||||
}
|
||||
StaticFieldRewriter staticFieldRewriter = new(
|
||||
semanticModel,
|
||||
discoveredTypes,
|
||||
constantDefinitions,
|
||||
context);
|
||||
|
||||
ConstantPropertyRewriter constantPropertyRewriter = new(
|
||||
semanticModel,
|
||||
discoveredTypes,
|
||||
constantDefinitions,
|
||||
context);
|
||||
string? assignment = staticFieldRewriter.Visit(variableDeclarator)?.NormalizeWhitespace().ToFullString();
|
||||
|
||||
if (constantPropertyRewriter.Visit(propertyDeclaration) is ExpressionSyntax expression)
|
||||
{
|
||||
string typeName = HlslKnownTypes.GetMappedName(typeSymbol);
|
||||
|
||||
_ = HlslKnownKeywords.TryGetMappedName(propertySymbol.Name, out string? mapping);
|
||||
|
||||
yield return new[] { mapping ?? propertySymbol.Name, typeName, expression.NormalizeWhitespace().ToFullString() };
|
||||
yield return new[] { mapping ?? fieldSymbol.Name, typeDeclaration, assignment };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,6 +412,19 @@ namespace ComputeSharp.SourceGenerators
|
||||
.ToFullString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds and reports all declared properties in a shader.
|
||||
/// </summary>
|
||||
/// <param name="context">The current generator context in use.</param>
|
||||
/// <param name="structDeclarationSymbol">The input <see cref="INamedTypeSymbol"/> instance to process.</param>
|
||||
private static void DetectAndReportPropertyDeclarations(GeneratorExecutionContext context, INamedTypeSymbol structDeclarationSymbol)
|
||||
{
|
||||
foreach (var propertySymbol in structDeclarationSymbol.GetMembers().OfType<IPropertySymbol>())
|
||||
{
|
||||
context.ReportDiagnostic(DiagnosticDescriptors.PropertyDeclaration, propertySymbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-16
@@ -14,18 +14,18 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||
namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
{
|
||||
/// <summary>
|
||||
/// A custom <see cref="CSharpSyntaxRewriter"/> type that processes C# static properties to convert to HLSL static constants.
|
||||
/// A custom <see cref="CSharpSyntaxRewriter"/> type that processes C# static field to convert to HLSL static fields (possibly constant).
|
||||
/// </summary>
|
||||
internal sealed class ConstantPropertyRewriter : HlslSourceRewriter
|
||||
internal sealed class StaticFieldRewriter : HlslSourceRewriter
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ConstantPropertyRewriter"/> instance with the specified parameters.
|
||||
/// Creates a new <see cref="StaticFieldRewriter"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
/// <param name="semanticModel">The <see cref="SemanticModel"/> instance for the target syntax tree.</param>
|
||||
/// <param name="discoveredTypes">The set of discovered custom types.</param>
|
||||
/// <param name="constantDefinitions">The collection of discovered constant definitions.</param>
|
||||
/// <param name="context">The current generator context in use.</param>
|
||||
public ConstantPropertyRewriter(
|
||||
public StaticFieldRewriter(
|
||||
SemanticModel semanticModel,
|
||||
ICollection<INamedTypeSymbol> discoveredTypes,
|
||||
IDictionary<IFieldSymbol, string> constantDefinitions,
|
||||
@@ -35,22 +35,14 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="CSharpSyntaxRewriter.Visit(SyntaxNode?)"/>
|
||||
public ExpressionSyntax? Visit(PropertyDeclarationSyntax? node)
|
||||
public ExpressionSyntax? Visit(VariableDeclaratorSyntax? node)
|
||||
{
|
||||
if (node!.ExpressionBody is null)
|
||||
if (node?.Initializer is EqualsValueClauseSyntax fieldInitializer)
|
||||
{
|
||||
Context.ReportDiagnostic(
|
||||
InvalidShaderConstantPropertyDeclaration,
|
||||
node,
|
||||
SemanticModel.GetDeclaredSymbol(node.FirstAncestorOrSelf<StructDeclarationSyntax>()!)!,
|
||||
SemanticModel.GetDeclaredSymbol(node)!.Name);
|
||||
|
||||
return null;
|
||||
return ((EqualsValueClauseSyntax)Visit(fieldInitializer))!.Value;
|
||||
}
|
||||
|
||||
ArrowExpressionClauseSyntax? updatedNode = (ArrowExpressionClauseSyntax?)Visit(node.ExpressionBody)!;
|
||||
|
||||
return updatedNode.Expression;
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -25,7 +25,7 @@ namespace ComputeSharp.__Internals
|
||||
/// <param name="executeMethod">The source code for the <see cref="IComputeShader.Execute"/> method.</param>
|
||||
/// <param name="methods">The collection of processed methods.</param>
|
||||
/// <param name="defines">The collection of discovered defines.</param>
|
||||
/// <param name="constants">The collection of discovered constants.</param>
|
||||
/// <param name="staticFields">The collection of discovered static fields.</param>
|
||||
/// <param name="sharedBuffers">The collection of group shared buffers.</param>
|
||||
public IComputeShaderSourceAttribute(
|
||||
Type shaderType,
|
||||
@@ -34,7 +34,7 @@ namespace ComputeSharp.__Internals
|
||||
string executeMethod,
|
||||
string[] methods,
|
||||
object[] defines,
|
||||
object[] constants,
|
||||
object[] staticFields,
|
||||
object[] sharedBuffers)
|
||||
{
|
||||
ShaderType = shaderType;
|
||||
@@ -43,7 +43,7 @@ namespace ComputeSharp.__Internals
|
||||
ExecuteMethod = executeMethod;
|
||||
Methods = methods;
|
||||
Defines = defines.Cast<string[]>().ToDictionary(static c => c[0], static c => c[1]);
|
||||
Constants = constants.Cast<string[]>().ToDictionary(static arg => arg[0], static arg => (arg[1], arg[2]));
|
||||
StaticFields = staticFields.Cast<string?[]>().ToDictionary(static arg => arg[0]!, static arg => (arg[1]!, arg[2]));
|
||||
SharedBuffers = sharedBuffers.Cast<object[]>().ToDictionary(static t => (string)t[0], static t => ((string)t[1], (int?)t[2]));
|
||||
}
|
||||
|
||||
@@ -78,9 +78,9 @@ namespace ComputeSharp.__Internals
|
||||
internal IReadOnlyDictionary<string, string> Defines { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of discovered constants.
|
||||
/// Gets the collection of discovered static fields.
|
||||
/// </summary>
|
||||
internal IReadOnlyDictionary<string, (string Type, string Assignment)> Constants { get; }
|
||||
internal IReadOnlyDictionary<string, (string TypeDeclaration, string? Assignment)> StaticFields { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of discovered shared buffers.
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace ComputeSharp
|
||||
/// 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.
|
||||
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
|
||||
/// </remarks>
|
||||
public static void AllMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrier)}()");
|
||||
|
||||
@@ -24,27 +25,32 @@ namespace ComputeSharp
|
||||
/// 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.
|
||||
/// <para>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</para>
|
||||
/// </remarks>
|
||||
public static void AllMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(AllMemoryBarrierWithGroupSync)}()");
|
||||
|
||||
/// <summary>
|
||||
/// Blocks execution of all threads in a group until all device memory accesses have been completed.
|
||||
/// </summary>
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void DeviceMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrier)}()");
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void DeviceMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(DeviceMemoryBarrierWithGroupSync)}()");
|
||||
|
||||
/// <summary>
|
||||
/// Blocks execution of all threads in a group until all group shared accesses have been completed.
|
||||
/// </summary>
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void GroupMemoryBarrier() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrier)}()");
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
/// </summary>
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void GroupMemoryBarrierWithGroupSync() => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(GroupMemoryBarrierWithGroupSync)}()");
|
||||
|
||||
/// <summary>
|
||||
@@ -52,14 +58,16 @@ namespace ComputeSharp
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedAdd(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAdd(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic add of a value to a destination.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedAdd(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAdd(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic add of a value to a destination.
|
||||
@@ -67,7 +75,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original input value.</param>
|
||||
public static void InterlockedAdd(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAdd(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic add of a value to a destination.
|
||||
@@ -75,21 +84,24 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original input value.</param>
|
||||
public static void InterlockedAdd(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAdd(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAdd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic and of a value to a destination.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedAnd(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAnd(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic and of a value to a destination.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedAnd(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAnd(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic and of a value to a destination.
|
||||
@@ -97,7 +109,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original input value.</param>
|
||||
public static void InterlockedAnd(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAnd(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic and of a value to a destination.
|
||||
@@ -105,7 +118,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original input value.</param>
|
||||
public static void InterlockedAnd(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedAnd(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedAnd)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Atomically compares the destination with the comparison value. If they are identical, the destination
|
||||
@@ -115,7 +129,8 @@ namespace ComputeSharp
|
||||
/// <param name="comparison">The comparison value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
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)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedCompareExchange(ref int destination, int comparison, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Atomically compares the destination with the comparison value. If they are identical, the destination
|
||||
@@ -125,7 +140,8 @@ namespace ComputeSharp
|
||||
/// <param name="comparison">The comparison value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
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)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedCompareExchange(ref uint destination, uint comparison, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Atomically compares the destination to the comparison value. If they
|
||||
@@ -134,7 +150,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="comparison">The comparison value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedCompareStore(int destination, int comparison, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedCompareStore(ref int destination, int comparison, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Atomically compares the destination to the comparison value. If they
|
||||
@@ -143,7 +160,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="comparison">The comparison value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedCompareStore(uint destination, uint comparison, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedCompareStore(ref uint destination, uint comparison, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedCompareStore)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Assigns value to dest and returns the original value.
|
||||
@@ -151,7 +169,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedExchange(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedExchange(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Assigns value to dest and returns the original value.
|
||||
@@ -159,21 +178,24 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedExchange(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedExchange(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedExchange)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic max.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedMax(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMax(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic max.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedMax(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMax(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic max.
|
||||
@@ -181,7 +203,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedMax(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMax(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic max.
|
||||
@@ -189,21 +212,24 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedMax(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMax(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMax)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic min.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedMin(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMin(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic min.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedMin(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMin(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic min.
|
||||
@@ -211,7 +237,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedMin(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMin(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic min.
|
||||
@@ -219,21 +246,24 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedMin(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedMin(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedMin)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic or.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedOr(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedOr(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic or.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedOr(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedOr(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic or.
|
||||
@@ -241,7 +271,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedOr(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedOr(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic or.
|
||||
@@ -249,21 +280,24 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedOr(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedOr(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedOr)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic xor.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedXor(int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedXor(ref int destination, int value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic xor.
|
||||
/// </summary>
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
public static void InterlockedXor(uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedXor(ref uint destination, uint value) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic xor.
|
||||
@@ -271,7 +305,8 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedXor(int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedXor(ref int destination, int value, out int original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(int)}, {typeof(int)}, {typeof(int)})");
|
||||
|
||||
/// <summary>
|
||||
/// Performs a guaranteed atomic xor.
|
||||
@@ -279,6 +314,7 @@ namespace ComputeSharp
|
||||
/// <param name="destination">The destination value.</param>
|
||||
/// <param name="value">The input value.</param>
|
||||
/// <param name="original">The original value.</param>
|
||||
public static void InterlockedXor(uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static void InterlockedXor(ref uint destination, uint value, out uint original) => throw new InvalidExecutionContextException($"{typeof(Hlsl)}.{nameof(InterlockedXor)}({typeof(uint)}, {typeof(uint)}, {typeof(uint)})");
|
||||
}
|
||||
}
|
||||
+3130
-3050
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -37,16 +37,27 @@ foreach (var intrinsic in Intrinsics)
|
||||
WriteLine($"/// <returns>{returns}</returns>");
|
||||
}
|
||||
|
||||
WriteLine("/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>");
|
||||
|
||||
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(");
|
||||
Write(")");
|
||||
|
||||
var parameters = string.Join(", ", overload.Params.Select(t => $"{{typeof({t})}}"));
|
||||
if (intrinsic.Parameters.Any(param => param.IsOut))
|
||||
{
|
||||
Write(" => throw new InvalidExecutionContextException(");
|
||||
|
||||
WriteLine($"$\"{{typeof(Hlsl)}}.{{nameof({intrinsic.Name})}}({parameters})\");");
|
||||
var parameters = string.Join(", ", overload.Params.Select(t => $"{{typeof({t})}}"));
|
||||
|
||||
WriteLine($"$\"{{typeof(Hlsl)}}.{{nameof({intrinsic.Name})}}({parameters})\");");
|
||||
}
|
||||
else
|
||||
{
|
||||
Write(" => default;");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Bool2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Bool2
|
||||
public unsafe partial struct Bool2
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool2), sizeof(Bool2));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private bool x;
|
||||
|
||||
@@ -17,66 +27,75 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Bool2"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref bool this[int i] => throw new InvalidExecutionContextException($"{typeof(Bool2)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref bool this[int i] => ref *(bool*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref bool X => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(X)}");
|
||||
public ref bool X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref bool Y => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(Y)}");
|
||||
public ref bool Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 XX => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 XX => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 XY => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 XY => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 YX => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 YX => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 YY => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 YY => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref bool R => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(R)}");
|
||||
public ref bool R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref bool G => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(G)}");
|
||||
public ref bool G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 RR => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 RR => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 RG => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 RG => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 GR => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 GR => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 GG => throw new InvalidExecutionContextException($"{typeof(Bool2)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 GG => ref *(Bool2*)UndefinedData;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Bool3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Bool3
|
||||
public unsafe partial struct Bool3
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Bool3), sizeof(Bool3));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private bool x;
|
||||
|
||||
@@ -20,396 +30,469 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Bool3"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref bool this[int i] => throw new InvalidExecutionContextException($"{typeof(Bool3)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref bool this[int i] => ref *(bool*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref bool X => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(X)}");
|
||||
public ref bool X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref bool Y => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(Y)}");
|
||||
public ref bool Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>Z</c> component.
|
||||
/// </summary>
|
||||
public ref bool Z => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(Z)}");
|
||||
public ref bool Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 XX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 XX => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 XY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 XY => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 XZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 XZ => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 YX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 YX => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 YY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 YY => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 YZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 YZ => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 ZX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 ZX => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 ZY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 ZY => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 ZZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 ZZ => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 XXX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 XXX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 XXY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 XXY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 XXZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 XXZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 XYX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 XYX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 XYY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 XYY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 XYZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 XYZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 XZX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 XZX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 XZY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 XZY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 XZZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(XZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 XZZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 YXX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 YXX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 YXY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 YXY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 YXZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 YXZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 YYX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 YYX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 YYY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 YYY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 YYZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 YYZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 YZX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 YZX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 YZY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 YZY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 YZZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(YZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 YZZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 ZXX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 ZXX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 ZXY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 ZXY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 ZXZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 ZXZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 ZYX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 ZYX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 ZYY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 ZYY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 ZYZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 ZYZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 ZZX => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 ZZX => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 ZZY => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 ZZY => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 ZZZ => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(ZZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 ZZZ => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref bool R => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(R)}");
|
||||
public ref bool R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref bool G => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(G)}");
|
||||
public ref bool G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="bool"/> value representing the <c>B</c> component.
|
||||
/// </summary>
|
||||
public ref bool B => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(B)}");
|
||||
public ref bool B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 RR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 RR => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 RG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 RG => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 RB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 RB => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 GR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 GR => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 GG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 GG => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 GB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 GB => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 BR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 BR => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool2"/> value with the components <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Bool2 BG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool2 BG => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool2"/> value with the components <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool2 BB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool2 BB => ref *(Bool2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 RRR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 RRR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 RRG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 RRG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 RRB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 RRB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 RGR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 RGR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 RGG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 RGG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 RGB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 RGB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 RBR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 RBR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 RBG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 RBG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 RBB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(RBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 RBB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 GRR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 GRR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 GRG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 GRG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 GRB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 GRB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 GGR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 GGR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 GGG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 GGG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 GGB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 GGB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 GBR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 GBR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 GBG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 GBG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 GBB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(GBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 GBB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 BRR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 BRR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 BRG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 BRG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 BRB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 BRB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Bool3 BGR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Bool3 BGR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 BGG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 BGG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 BGB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 BGB => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 BBR => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 BBR => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 BBG => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 BBG => ref *(Bool3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Bool3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Bool3 BBB => throw new InvalidExecutionContextException($"{typeof(Bool3)}.{nameof(BBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Bool3 BBB => ref *(Bool3*)UndefinedData;
|
||||
}
|
||||
}
|
||||
ファイル差分が大きすぎるため表示されません。
差分を読み込み
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -50,18 +49,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Double2"/> value to a <see cref="Int2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
|
||||
public static explicit operator Int2(Double2 xy) => throw new InvalidExecutionContextException($"{nameof(Double2)}.({nameof(Int2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int2(Double2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Double2"/> value to a <see cref="UInt2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
|
||||
public static explicit operator UInt2(Double2 xy) => throw new InvalidExecutionContextException($"{nameof(Double2)}.({nameof(UInt2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt2(Double2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Double2"/> value to a <see cref="Float2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Double2"/> value to cast.</param>
|
||||
public static explicit operator Float2(Double2 xy) => throw new InvalidExecutionContextException($"{nameof(Double2)}.({nameof(Float2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Float2(Double2 xy) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Double2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 8)]
|
||||
public partial struct Double2
|
||||
public unsafe partial struct Double2
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double2), sizeof(Double2));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private double x;
|
||||
|
||||
@@ -17,100 +27,114 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Double2"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref double this[int i] => throw new InvalidExecutionContextException($"{typeof(Double2)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref double this[int i] => ref *(double*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref double X => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(X)}");
|
||||
public ref double X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref double Y => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(Y)}");
|
||||
public ref double Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 XX => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 XX => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Double2 XY => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 XY => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Double2 YX => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 YX => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 YY => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 YY => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref double R => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(R)}");
|
||||
public ref double R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref double G => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(G)}");
|
||||
public ref double G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 RR => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 RR => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Double2 RG => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 RG => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Double2 GR => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 GR => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 GG => throw new InvalidExecutionContextException($"{typeof(Double2)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 GG => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Double2"/> value.
|
||||
/// </summary>
|
||||
/// <param name="xy">The <see cref="Double2"/> value to negate.</param>
|
||||
public static Double2 operator -(Double2 xy) => throw new InvalidExecutionContextException($"{typeof(Double2)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double2 operator -(Double2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="Double2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double2"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="Double2"/> value to sum.</param>
|
||||
public static Double2 operator +(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{typeof(Double2)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double2 operator +(Double2 left, Double2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="Double2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double2"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="Double2"/> value to divide.</param>
|
||||
public static Double2 operator /(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{typeof(Double2)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double2 operator /(Double2 left, Double2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="Double2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double2"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="Double2"/> value to multiply.</param>
|
||||
public static Double2 operator *(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{typeof(Double2)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double2 operator *(Double2 left, Double2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="Double2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double2"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="Double2"/> value to subtract.</param>
|
||||
public static Double2 operator -(Double2 left, Double2 right) => throw new InvalidExecutionContextException($"{typeof(Double2)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double2 operator -(Double2 left, Double2 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -81,18 +80,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Double3"/> value to a <see cref="Int3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
|
||||
public static explicit operator Int3(Double3 xyz) => throw new InvalidExecutionContextException($"{nameof(Double3)}.({nameof(Int3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int3(Double3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Double3"/> value to a <see cref="UInt3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
|
||||
public static explicit operator UInt3(Double3 xyz) => throw new InvalidExecutionContextException($"{nameof(Double3)}.({nameof(UInt3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt3(Double3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Double3"/> value to a <see cref="Float3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Double3"/> value to cast.</param>
|
||||
public static explicit operator Float3(Double3 xyz) => throw new InvalidExecutionContextException($"{nameof(Double3)}.({nameof(Float3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Float3(Double3 xyz) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Double3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 24, Pack = 8)]
|
||||
public partial struct Double3
|
||||
public unsafe partial struct Double3
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Double3), sizeof(Double3));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private double x;
|
||||
|
||||
@@ -20,430 +30,508 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Double3"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref double this[int i] => throw new InvalidExecutionContextException($"{typeof(Double3)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref double this[int i] => ref *(double*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref double X => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(X)}");
|
||||
public ref double X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref double Y => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(Y)}");
|
||||
public ref double Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>Z</c> component.
|
||||
/// </summary>
|
||||
public ref double Z => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(Z)}");
|
||||
public ref double Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 XX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 XX => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Double2 XY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 XY => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Double2 XZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 XZ => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Double2 YX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 YX => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 YY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 YY => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Double2 YZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 YZ => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Double2 ZX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 ZX => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Double2 ZY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 ZY => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 ZZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 ZZ => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 XXX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 XXX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 XXY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 XXY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 XXZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 XXZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 XYX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 XYX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 XYY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 XYY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Double3 XYZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 XYZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 XZX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 XZX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Double3 XZY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 XZY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 XZZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(XZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 XZZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 YXX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 YXX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 YXY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 YXY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Double3 YXZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 YXZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 YYX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 YYX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 YYY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 YYY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 YYZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 YYZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Double3 YZX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 YZX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 YZY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 YZY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 YZZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(YZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 YZZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 ZXX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 ZXX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Double3 ZXY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 ZXY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 ZXZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 ZXZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Double3 ZYX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 ZYX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 ZYY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 ZYY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 ZYZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 ZYZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 ZZX => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 ZZX => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 ZZY => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 ZZY => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 ZZZ => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(ZZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 ZZZ => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref double R => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(R)}");
|
||||
public ref double R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref double G => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(G)}");
|
||||
public ref double G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="double"/> value representing the <c>B</c> component.
|
||||
/// </summary>
|
||||
public ref double B => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(B)}");
|
||||
public ref double B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 RR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 RR => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Double2 RG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 RG => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Double2 RB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 RB => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Double2 GR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 GR => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 GG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 GG => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Double2 GB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 GB => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Double2 BR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 BR => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double2"/> value with the components <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Double2 BG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double2 BG => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double2"/> value with the components <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double2 BB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double2 BB => ref *(Double2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 RRR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 RRR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 RRG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 RRG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 RRB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 RRB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 RGR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 RGR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 RGG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 RGG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Double3 RGB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 RGB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 RBR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 RBR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Double3 RBG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 RBG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 RBB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(RBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 RBB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 GRR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 GRR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 GRG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 GRG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Double3 GRB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 GRB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 GGR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 GGR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 GGG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 GGG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 GGB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 GGB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Double3 GBR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 GBR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 GBG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 GBG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 GBB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(GBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 GBB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 BRR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 BRR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Double3 BRG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 BRG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 BRB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 BRB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Double3 BGR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Double3 BGR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 BGG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 BGG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 BGB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 BGB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 BBR => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 BBR => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 BBG => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 BBG => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Double3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Double3 BBB => throw new InvalidExecutionContextException($"{typeof(Double3)}.{nameof(BBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Double3 BBB => ref *(Double3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Double3"/> value.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The <see cref="Double3"/> value to negate.</param>
|
||||
public static Double3 operator -(Double3 xyz) => throw new InvalidExecutionContextException($"{typeof(Double3)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double3 operator -(Double3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="Double3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double3"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="Double3"/> value to sum.</param>
|
||||
public static Double3 operator +(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{typeof(Double3)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double3 operator +(Double3 left, Double3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="Double3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double3"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="Double3"/> value to divide.</param>
|
||||
public static Double3 operator /(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{typeof(Double3)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double3 operator /(Double3 left, Double3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="Double3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double3"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="Double3"/> value to multiply.</param>
|
||||
public static Double3 operator *(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{typeof(Double3)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double3 operator *(Double3 left, Double3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="Double3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Double3"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="Double3"/> value to subtract.</param>
|
||||
public static Double3 operator -(Double3 left, Double3 right) => throw new InvalidExecutionContextException($"{typeof(Double3)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Double3 operator -(Double3 left, Double3 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -131,18 +130,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Double4"/> value to a <see cref="Int4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
|
||||
public static explicit operator Int4(Double4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Double4)}.({nameof(Int4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int4(Double4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Double4"/> value to a <see cref="UInt4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
|
||||
public static explicit operator UInt4(Double4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Double4)}.({nameof(UInt4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt4(Double4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Double4"/> value to a <see cref="Float4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Double4"/> value to cast.</param>
|
||||
public static explicit operator Float4(Double4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Double4)}.({nameof(Float4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Float4(Double4 xyzw) => default;
|
||||
}
|
||||
}
|
||||
ファイル差分が大きすぎるため表示されません。
差分を読み込み
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -1,6 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -63,18 +62,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Float2"/> value to a <see cref="Double2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
|
||||
public static implicit operator Double2(Float2 xy) => throw new InvalidExecutionContextException($"{nameof(Float2)}.({nameof(Double2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double2(Float2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Float2"/> value to a <see cref="Int2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
|
||||
public static explicit operator Int2(Float2 xy) => throw new InvalidExecutionContextException($"{nameof(Float2)}.({nameof(Int2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int2(Float2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Float2"/> value to a <see cref="UInt2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Float2"/> value to cast.</param>
|
||||
public static explicit operator UInt2(Float2 xy) => throw new InvalidExecutionContextException($"{nameof(Float2)}.({nameof(UInt2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt2(Float2 xy) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Float2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Float2
|
||||
public unsafe partial struct Float2
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float2), sizeof(Float2));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private float x;
|
||||
|
||||
@@ -17,100 +27,114 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Float2"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref float this[int i] => throw new InvalidExecutionContextException($"{typeof(Float2)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref float this[int i] => ref *(float*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref float X => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(X)}");
|
||||
public ref float X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref float Y => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(Y)}");
|
||||
public ref float Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 XX => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 XX => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Float2 XY => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 XY => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Float2 YX => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 YX => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 YY => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 YY => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref float R => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(R)}");
|
||||
public ref float R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref float G => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(G)}");
|
||||
public ref float G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 RR => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 RR => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Float2 RG => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 RG => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Float2 GR => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 GR => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 GG => throw new InvalidExecutionContextException($"{typeof(Float2)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 GG => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Float2"/> value.
|
||||
/// </summary>
|
||||
/// <param name="xy">The <see cref="Float2"/> value to negate.</param>
|
||||
public static Float2 operator -(Float2 xy) => throw new InvalidExecutionContextException($"{typeof(Float2)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float2 operator -(Float2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="Float2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float2"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="Float2"/> value to sum.</param>
|
||||
public static Float2 operator +(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{typeof(Float2)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float2 operator +(Float2 left, Float2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="Float2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float2"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="Float2"/> value to divide.</param>
|
||||
public static Float2 operator /(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{typeof(Float2)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float2 operator /(Float2 left, Float2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="Float2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float2"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="Float2"/> value to multiply.</param>
|
||||
public static Float2 operator *(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{typeof(Float2)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float2 operator *(Float2 left, Float2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="Float2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float2"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="Float2"/> value to subtract.</param>
|
||||
public static Float2 operator -(Float2 left, Float2 right) => throw new InvalidExecutionContextException($"{typeof(Float2)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float2 operator -(Float2 left, Float2 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -94,18 +93,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Float3"/> value to a <see cref="Double3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
|
||||
public static implicit operator Double3(Float3 xyz) => throw new InvalidExecutionContextException($"{nameof(Float3)}.({nameof(Double3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double3(Float3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Float3"/> value to a <see cref="Int3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
|
||||
public static explicit operator Int3(Float3 xyz) => throw new InvalidExecutionContextException($"{nameof(Float3)}.({nameof(Int3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int3(Float3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Float3"/> value to a <see cref="UInt3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Float3"/> value to cast.</param>
|
||||
public static explicit operator UInt3(Float3 xyz) => throw new InvalidExecutionContextException($"{nameof(Float3)}.({nameof(UInt3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt3(Float3 xyz) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Float3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Float3
|
||||
public unsafe partial struct Float3
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Float3), sizeof(Float3));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private float x;
|
||||
|
||||
@@ -20,430 +30,508 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Float3"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref float this[int i] => throw new InvalidExecutionContextException($"{typeof(Float3)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref float this[int i] => ref *(float*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref float X => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(X)}");
|
||||
public ref float X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref float Y => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(Y)}");
|
||||
public ref float Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>Z</c> component.
|
||||
/// </summary>
|
||||
public ref float Z => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(Z)}");
|
||||
public ref float Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 XX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 XX => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Float2 XY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 XY => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Float2 XZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 XZ => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Float2 YX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 YX => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 YY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 YY => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Float2 YZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 YZ => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Float2 ZX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 ZX => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Float2 ZY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 ZY => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 ZZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 ZZ => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 XXX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 XXX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 XXY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 XXY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 XXZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 XXZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 XYX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 XYX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 XYY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 XYY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Float3 XYZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 XYZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 XZX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 XZX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Float3 XZY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 XZY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 XZZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(XZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 XZZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 YXX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 YXX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 YXY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 YXY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Float3 YXZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 YXZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 YYX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 YYX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 YYY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 YYY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 YYZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 YYZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Float3 YZX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 YZX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 YZY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 YZY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 YZZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(YZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 YZZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 ZXX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 ZXX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Float3 ZXY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 ZXY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 ZXZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 ZXZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Float3 ZYX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 ZYX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 ZYY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 ZYY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 ZYZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 ZYZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 ZZX => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 ZZX => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 ZZY => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 ZZY => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 ZZZ => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(ZZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 ZZZ => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref float R => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(R)}");
|
||||
public ref float R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref float G => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(G)}");
|
||||
public ref float G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="float"/> value representing the <c>B</c> component.
|
||||
/// </summary>
|
||||
public ref float B => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(B)}");
|
||||
public ref float B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 RR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 RR => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Float2 RG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 RG => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Float2 RB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 RB => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Float2 GR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 GR => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 GG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 GG => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Float2 GB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 GB => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Float2 BR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 BR => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float2"/> value with the components <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Float2 BG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float2 BG => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float2"/> value with the components <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float2 BB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float2 BB => ref *(Float2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 RRR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 RRR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 RRG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 RRG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 RRB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 RRB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 RGR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 RGR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 RGG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 RGG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Float3 RGB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 RGB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 RBR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 RBR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Float3 RBG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 RBG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 RBB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(RBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 RBB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 GRR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 GRR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 GRG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 GRG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Float3 GRB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 GRB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 GGR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 GGR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 GGG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 GGG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 GGB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 GGB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Float3 GBR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 GBR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 GBG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 GBG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 GBB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(GBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 GBB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 BRR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 BRR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Float3 BRG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 BRG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 BRB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 BRB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Float3 BGR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Float3 BGR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 BGG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 BGG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 BGB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 BGB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 BBR => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 BBR => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 BBG => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 BBG => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Float3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Float3 BBB => throw new InvalidExecutionContextException($"{typeof(Float3)}.{nameof(BBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Float3 BBB => ref *(Float3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Float3"/> value.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The <see cref="Float3"/> value to negate.</param>
|
||||
public static Float3 operator -(Float3 xyz) => throw new InvalidExecutionContextException($"{typeof(Float3)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float3 operator -(Float3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="Float3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float3"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="Float3"/> value to sum.</param>
|
||||
public static Float3 operator +(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{typeof(Float3)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float3 operator +(Float3 left, Float3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="Float3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float3"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="Float3"/> value to divide.</param>
|
||||
public static Float3 operator /(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{typeof(Float3)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float3 operator /(Float3 left, Float3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="Float3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float3"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="Float3"/> value to multiply.</param>
|
||||
public static Float3 operator *(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{typeof(Float3)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float3 operator *(Float3 left, Float3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="Float3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Float3"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="Float3"/> value to subtract.</param>
|
||||
public static Float3 operator -(Float3 left, Float3 right) => throw new InvalidExecutionContextException($"{typeof(Float3)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Float3 operator -(Float3 left, Float3 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System.Numerics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -144,18 +143,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Float4"/> value to a <see cref="Double4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
|
||||
public static implicit operator Double4(Float4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Float4)}.({nameof(Double4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double4(Float4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Float4"/> value to a <see cref="Int4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
|
||||
public static explicit operator Int4(Float4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Float4)}.({nameof(Int4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int4(Float4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Float4"/> value to a <see cref="UInt4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Float4"/> value to cast.</param>
|
||||
public static explicit operator UInt4(Float4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Float4)}.({nameof(UInt4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt4(Float4 xyzw) => default;
|
||||
}
|
||||
}
|
||||
ファイル差分が大きすぎるため表示されません。
差分を読み込み
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -50,18 +49,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Int2"/> value to a <see cref="UInt2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
|
||||
public static explicit operator UInt2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(UInt2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt2(Int2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Int2"/> value to a <see cref="Float2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
|
||||
public static implicit operator Float2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(Float2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Float2(Int2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Int2"/> value to a <see cref="Double2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="Int2"/> value to cast.</param>
|
||||
public static implicit operator Double2(Int2 xy) => throw new InvalidExecutionContextException($"{nameof(Int2)}.({nameof(Double2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double2(Int2 xy) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Int2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct Int2
|
||||
public unsafe partial struct Int2
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int2), sizeof(Int2));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private int x;
|
||||
|
||||
@@ -17,100 +27,114 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Int2"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref int this[int i] => throw new InvalidExecutionContextException($"{typeof(Int2)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref int this[int i] => ref *(int*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref int X => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(X)}");
|
||||
public ref int X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref int Y => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(Y)}");
|
||||
public ref int Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 XX => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 XX => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Int2 XY => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 XY => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Int2 YX => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 YX => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 YY => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 YY => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref int R => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(R)}");
|
||||
public ref int R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref int G => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(G)}");
|
||||
public ref int G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 RR => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 RR => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Int2 RG => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 RG => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Int2 GR => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 GR => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 GG => throw new InvalidExecutionContextException($"{typeof(Int2)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 GG => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Int2"/> value.
|
||||
/// </summary>
|
||||
/// <param name="xy">The <see cref="Int2"/> value to negate.</param>
|
||||
public static Int2 operator -(Int2 xy) => throw new InvalidExecutionContextException($"{typeof(Int2)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int2 operator -(Int2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="Int2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int2"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="Int2"/> value to sum.</param>
|
||||
public static Int2 operator +(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{typeof(Int2)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int2 operator +(Int2 left, Int2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="Int2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int2"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="Int2"/> value to divide.</param>
|
||||
public static Int2 operator /(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{typeof(Int2)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int2 operator /(Int2 left, Int2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="Int2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int2"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="Int2"/> value to multiply.</param>
|
||||
public static Int2 operator *(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{typeof(Int2)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int2 operator *(Int2 left, Int2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="Int2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int2"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="Int2"/> value to subtract.</param>
|
||||
public static Int2 operator -(Int2 left, Int2 right) => throw new InvalidExecutionContextException($"{typeof(Int2)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int2 operator -(Int2 left, Int2 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -81,18 +80,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Int3"/> value to a <see cref="UInt3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
|
||||
public static explicit operator UInt3(Int3 xyz) => throw new InvalidExecutionContextException($"{nameof(Int3)}.({nameof(UInt3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt3(Int3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Int3"/> value to a <see cref="Float3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
|
||||
public static implicit operator Float3(Int3 xyz) => throw new InvalidExecutionContextException($"{nameof(Int3)}.({nameof(Float3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Float3(Int3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Int3"/> value to a <see cref="Double3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="Int3"/> value to cast.</param>
|
||||
public static implicit operator Double3(Int3 xyz) => throw new InvalidExecutionContextException($"{nameof(Int3)}.({nameof(Double3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double3(Int3 xyz) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="Int3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct Int3
|
||||
public unsafe partial struct Int3
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(Int3), sizeof(Int3));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private int x;
|
||||
|
||||
@@ -20,430 +30,508 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="Int3"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref int this[int i] => throw new InvalidExecutionContextException($"{typeof(Int3)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref int this[int i] => ref *(int*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref int X => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(X)}");
|
||||
public ref int X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref int Y => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(Y)}");
|
||||
public ref int Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>Z</c> component.
|
||||
/// </summary>
|
||||
public ref int Z => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(Z)}");
|
||||
public ref int Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 XX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 XX => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Int2 XY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 XY => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Int2 XZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 XZ => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Int2 YX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 YX => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 YY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 YY => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Int2 YZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 YZ => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Int2 ZX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 ZX => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Int2 ZY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 ZY => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 ZZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 ZZ => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 XXX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 XXX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 XXY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 XXY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 XXZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 XXZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 XYX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 XYX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 XYY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 XYY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Int3 XYZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 XYZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 XZX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 XZX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Int3 XZY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 XZY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 XZZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(XZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 XZZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 YXX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 YXX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 YXY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 YXY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref Int3 YXZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 YXZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 YYX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 YYX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 YYY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 YYY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 YYZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 YYZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Int3 YZX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 YZX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 YZY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 YZY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 YZZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(YZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 YZZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 ZXX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 ZXX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref Int3 ZXY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 ZXY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 ZXZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 ZXZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref Int3 ZYX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 ZYX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 ZYY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 ZYY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 ZYZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 ZYZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 ZZX => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 ZZX => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 ZZY => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 ZZY => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 ZZZ => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(ZZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 ZZZ => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref int R => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(R)}");
|
||||
public ref int R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref int G => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(G)}");
|
||||
public ref int G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="int"/> value representing the <c>B</c> component.
|
||||
/// </summary>
|
||||
public ref int B => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(B)}");
|
||||
public ref int B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 RR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 RR => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Int2 RG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 RG => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Int2 RB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 RB => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Int2 GR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 GR => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 GG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 GG => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Int2 GB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 GB => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Int2 BR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 BR => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int2"/> value with the components <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Int2 BG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int2 BG => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int2"/> value with the components <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int2 BB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int2 BB => ref *(Int2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 RRR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 RRR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 RRG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 RRG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 RRB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 RRB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 RGR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 RGR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 RGG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 RGG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Int3 RGB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 RGB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 RBR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 RBR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Int3 RBG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 RBG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 RBB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(RBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 RBB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 GRR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 GRR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 GRG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 GRG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref Int3 GRB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 GRB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 GGR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 GGR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 GGG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 GGG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 GGB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 GGB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Int3 GBR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 GBR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 GBG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 GBG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 GBB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(GBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 GBB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 BRR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 BRR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref Int3 BRG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 BRG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 BRB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 BRB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref Int3 BGR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref Int3 BGR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 BGG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 BGG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 BGB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 BGB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 BBR => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 BBR => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 BBG => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 BBG => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="Int3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly Int3 BBB => throw new InvalidExecutionContextException($"{typeof(Int3)}.{nameof(BBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly Int3 BBB => ref *(Int3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Negates a <see cref="Int3"/> value.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The <see cref="Int3"/> value to negate.</param>
|
||||
public static Int3 operator -(Int3 xyz) => throw new InvalidExecutionContextException($"{typeof(Int3)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int3 operator -(Int3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="Int3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int3"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="Int3"/> value to sum.</param>
|
||||
public static Int3 operator +(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{typeof(Int3)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int3 operator +(Int3 left, Int3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="Int3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int3"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="Int3"/> value to divide.</param>
|
||||
public static Int3 operator /(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{typeof(Int3)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int3 operator /(Int3 left, Int3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="Int3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int3"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="Int3"/> value to multiply.</param>
|
||||
public static Int3 operator *(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{typeof(Int3)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int3 operator *(Int3 left, Int3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="Int3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="Int3"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="Int3"/> value to subtract.</param>
|
||||
public static Int3 operator -(Int3 left, Int3 right) => throw new InvalidExecutionContextException($"{typeof(Int3)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static Int3 operator -(Int3 left, Int3 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -131,18 +130,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="Int4"/> value to a <see cref="UInt4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
|
||||
public static explicit operator UInt4(Int4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Int4)}.({nameof(UInt4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator UInt4(Int4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Int4"/> value to a <see cref="Float4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
|
||||
public static implicit operator Float4(Int4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Int4)}.({nameof(Float4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Float4(Int4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="Int4"/> value to a <see cref="Double4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="Int4"/> value to cast.</param>
|
||||
public static implicit operator Double4(Int4 xyzw) => throw new InvalidExecutionContextException($"{nameof(Int4)}.({nameof(Double4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double4(Int4 xyzw) => default;
|
||||
}
|
||||
}
|
||||
ファイル差分が大きすぎるため表示されません。
差分を読み込み
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -11,7 +11,12 @@ void GenerateAllMatrixProperties(string typeName, int elementSize)
|
||||
{
|
||||
#>
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -38,9 +43,14 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
#>
|
||||
/// <inheritdoc cref="<#=fullTypeName#>"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * rows * columns)#>, Pack = <#=elementSize#>)]
|
||||
public partial struct <#=fullTypeName#>
|
||||
public unsafe partial struct <#=fullTypeName#>
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(<#=fullTypeName#>), sizeof(<#=typeName#>4));
|
||||
<#
|
||||
WriteLine("");
|
||||
PushIndent(" ");
|
||||
PushIndent(" ");
|
||||
|
||||
@@ -121,14 +131,16 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// Gets a reference to a specific row in the current <see cref="<#=fullTypeName#>"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="row">The row to access.</param>
|
||||
public ref <#=rowTypeName#> this[int row] => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref <#=rowTypeName#> this[int row] => ref *(<#=rowTypeName#>*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a swizzled reference to a specific sequence of items in the current <see cref="<#=fullTypeName#>"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="xy0">The identifier of the first item to index.</param>
|
||||
/// <param name="xy1">The identifier of the second item to index.</param>
|
||||
public ref <#=typeName#>2 this[MatrixIndex xy0, MatrixIndex xy1] => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}[{typeof(MatrixIndex)}, {typeof(MatrixIndex)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref <#=typeName#>2 this[MatrixIndex xy0, MatrixIndex xy1] => ref *(<#=typeName#>2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a swizzled reference to a specific sequence of items in the current <see cref="<#=fullTypeName#>"/> instance.
|
||||
@@ -136,7 +148,8 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// <param name="xy0">The identifier of the first item to index.</param>
|
||||
/// <param name="xy1">The identifier of the second item to index.</param>
|
||||
/// <param name="xy2">The identifier of the third item to index.</param>
|
||||
public ref <#=typeName#>3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}[{typeof(MatrixIndex)}, {typeof(MatrixIndex)}, {typeof(MatrixIndex)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref <#=typeName#>3 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2] => ref *(<#=typeName#>3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a swizzled reference to a specific sequence of items in the current <see cref="<#=fullTypeName#>"/> instance.
|
||||
@@ -145,7 +158,8 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// <param name="xy1">The identifier of the second item to index.</param>
|
||||
/// <param name="xy2">The identifier of the third item to index.</param>
|
||||
/// <param name="xy3">The identifier of the fourth item to index.</param>
|
||||
public ref <#=typeName#>4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}[{typeof(MatrixIndex)}, {typeof(MatrixIndex)}, {typeof(MatrixIndex)}, {typeof(MatrixIndex)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref <#=typeName#>4 this[MatrixIndex xy0, MatrixIndex xy1, MatrixIndex xy2, MatrixIndex xy3] => ref *(<#=typeName#>4*)UndefinedData;
|
||||
<#
|
||||
for (int i = 1; i <= rows; i++)
|
||||
for (int j = 1; j <= columns; j++)
|
||||
@@ -155,7 +169,7 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="<#=elementTypeName#>"/> value representing the component at position [<#=i#>, <#=j#>].
|
||||
/// </summary>
|
||||
public ref <#=elementTypeName#> M<#=i#><#=j#> => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.M<#=i#><#=j#>");
|
||||
public ref <#=elementTypeName#> M<#=i#><#=j#> => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.m<#=i#><#=j#>, 1));
|
||||
<#
|
||||
}
|
||||
|
||||
@@ -198,7 +212,8 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// Negates a <see cref="<#=fullTypeName#>"/> value.
|
||||
/// </summary>
|
||||
/// <param name="matrix">The <see cref="<#=fullTypeName#>"/> value to negate.</param>
|
||||
public static <#=fullTypeName#> operator -(<#=fullTypeName#> matrix) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=fullTypeName#> operator -(<#=fullTypeName#> matrix) => default;
|
||||
<#
|
||||
}
|
||||
|
||||
@@ -212,28 +227,32 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=fullTypeName#>"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="<#=fullTypeName#>"/> value to sum.</param>
|
||||
public static <#=fullTypeName#> operator +(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=fullTypeName#> operator +(<#=fullTypeName#> left, <#=fullTypeName#> right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="<#=fullTypeName#>"/> values (elementwise division).
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=fullTypeName#>"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="<#=fullTypeName#>"/> value to divide.</param>
|
||||
public static <#=fullTypeName#> operator /(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=fullTypeName#> operator /(<#=fullTypeName#> left, <#=fullTypeName#> right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="<#=fullTypeName#>"/> values (elementwise product).
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=fullTypeName#>"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="<#=fullTypeName#>"/> value to multiply.</param>
|
||||
public static <#=fullTypeName#> operator *(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=fullTypeName#> operator *(<#=fullTypeName#> left, <#=fullTypeName#> right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="<#=fullTypeName#>"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=fullTypeName#>"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="<#=fullTypeName#>"/> value to subtract.</param>
|
||||
public static <#=fullTypeName#> operator -(<#=fullTypeName#> left, <#=fullTypeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=fullTypeName#> operator -(<#=fullTypeName#> left, <#=fullTypeName#> right) => default;
|
||||
<#
|
||||
}
|
||||
|
||||
@@ -246,7 +265,7 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// Casts a <see cref="<#=typeName#><#=columns#>"/> value to a <see cref="<#=fullTypeName#>"/> one.
|
||||
/// </summary>
|
||||
/// <param name="vector">The input <see cref="<#=typeName#><#=columns#>"/> value to cast.</param>
|
||||
public static implicit operator <#=fullTypeName#>(<#=typeName#><#=columns#> vector) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.{typeof(<#=fullTypeName#>)}({typeof(<#=typeName#><#=columns#>)})");
|
||||
public static implicit operator <#=fullTypeName#>(<#=typeName#><#=columns#> vector) => *(<#=fullTypeName#>*)&vector;
|
||||
<#
|
||||
}
|
||||
|
||||
@@ -258,7 +277,7 @@ void GenerateMatrixProperties(string typeName, int rows, int columns, int elemen
|
||||
/// Casts a <see cref="<#=fullTypeName#>"/> value to a <see cref="<#=typeName#><#=rows#>"/> one.
|
||||
/// </summary>
|
||||
/// <param name="matrix">The input <see cref="<#=fullTypeName#>"/> value to cast.</param>
|
||||
public static implicit operator <#=typeName#><#=rows#>(<#=fullTypeName#> matrix) => throw new InvalidExecutionContextException($"{typeof(<#=fullTypeName#>)}.{typeof(<#=typeName#><#=rows#>)}({typeof(<#=fullTypeName#>)})");
|
||||
public static implicit operator <#=typeName#><#=rows#>(<#=fullTypeName#> matrix) => *(<#=typeName#><#=rows#>*)&matrix;
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -50,18 +49,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="UInt2"/> value to a <see cref="Int2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
|
||||
public static explicit operator Int2(UInt2 xy) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.({nameof(Int2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int2(UInt2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="UInt2"/> value to a <see cref="Float2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
|
||||
public static implicit operator Float2(UInt2 xy) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.({nameof(Float2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Float2(UInt2 xy) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="UInt2"/> value to a <see cref="Double2"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xy">The input <see cref="UInt2"/> value to cast.</param>
|
||||
public static implicit operator Double2(UInt2 xy) => throw new InvalidExecutionContextException($"{nameof(UInt2)}.({nameof(Double2)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double2(UInt2 xy) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="UInt2"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8, Pack = 4)]
|
||||
public partial struct UInt2
|
||||
public unsafe partial struct UInt2
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt2), sizeof(UInt2));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private uint x;
|
||||
|
||||
@@ -17,94 +27,107 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="UInt2"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref uint this[int i] => throw new InvalidExecutionContextException($"{typeof(UInt2)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref uint this[int i] => ref *(uint*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref uint X => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(X)}");
|
||||
public ref uint X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref uint Y => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(Y)}");
|
||||
public ref uint Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 XX => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 XX => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 XY => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 XY => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 YX => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 YX => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 YY => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 YY => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref uint R => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(R)}");
|
||||
public ref uint R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref uint G => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(G)}");
|
||||
public ref uint G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 RR => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 RR => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 RG => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 RG => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 GR => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 GR => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 GG => throw new InvalidExecutionContextException($"{typeof(UInt2)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 GG => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="UInt2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt2"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="UInt2"/> value to sum.</param>
|
||||
public static UInt2 operator +(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{typeof(UInt2)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt2 operator +(UInt2 left, UInt2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="UInt2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt2"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="UInt2"/> value to divide.</param>
|
||||
public static UInt2 operator /(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{typeof(UInt2)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt2 operator /(UInt2 left, UInt2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="UInt2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt2"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="UInt2"/> value to multiply.</param>
|
||||
public static UInt2 operator *(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{typeof(UInt2)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt2 operator *(UInt2 left, UInt2 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="UInt2"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt2"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="UInt2"/> value to subtract.</param>
|
||||
public static UInt2 operator -(UInt2 left, UInt2 right) => throw new InvalidExecutionContextException($"{typeof(UInt2)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt2 operator -(UInt2 left, UInt2 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -81,18 +80,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="UInt3"/> value to a <see cref="Int3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
|
||||
public static explicit operator Int3(UInt3 xyz) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.({nameof(Int3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int3(UInt3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="UInt3"/> value to a <see cref="Float3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
|
||||
public static implicit operator Float3(UInt3 xyz) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.({nameof(Float3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Float3(UInt3 xyz) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="UInt3"/> value to a <see cref="Double3"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyz">The input <see cref="UInt3"/> value to cast.</param>
|
||||
public static implicit operator Double3(UInt3 xyz) => throw new InvalidExecutionContextException($"{nameof(UInt3)}.({nameof(Double3)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double3(UInt3 xyz) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,22 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="UInt3"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = 12, Pack = 4)]
|
||||
public partial struct UInt3
|
||||
public unsafe partial struct UInt3
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(UInt3), sizeof(UInt3));
|
||||
|
||||
[FieldOffset(0)]
|
||||
private uint x;
|
||||
|
||||
@@ -20,424 +30,501 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="UInt3"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref uint this[int i] => throw new InvalidExecutionContextException($"{typeof(UInt3)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref uint this[int i] => ref *(uint*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>X</c> component.
|
||||
/// </summary>
|
||||
public ref uint X => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(X)}");
|
||||
public ref uint X => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>Y</c> component.
|
||||
/// </summary>
|
||||
public ref uint Y => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(Y)}");
|
||||
public ref uint Y => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>Z</c> component.
|
||||
/// </summary>
|
||||
public ref uint Z => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(Z)}");
|
||||
public ref uint Z => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 XX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 XX => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 XY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 XY => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 XZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 XZ => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 YX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 YX => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 YY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 YY => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 YZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 YZ => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 ZX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 ZX => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 ZY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 ZY => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 ZZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 ZZ => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 XXX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 XXX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 XXY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 XXY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 XXZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 XXZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 XYX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 XYX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 XYY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 XYY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 XYZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 XYZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 XZX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 XZX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 XZY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 XZY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="X"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 XZZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(XZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 XZZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 YXX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 YXX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 YXY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 YXY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 YXZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 YXZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 YYX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 YYX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 YYY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 YYY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 YYZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 YYZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 YZX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 YZX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 YZY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 YZY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Y"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 YZZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(YZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 YZZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 ZXX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZXX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 ZXX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 ZXY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZXY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 ZXY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="X"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 ZXZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZXZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 ZXZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 ZYX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZYX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 ZYX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 ZYY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZYY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 ZYY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="Y"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 ZYZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZYZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 ZYZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="X"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 ZZX => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZZX)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 ZZX => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Y"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 ZZY => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZZY)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 ZZY => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="Z"/>, <see cref="Z"/>, <see cref="Z"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 ZZZ => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(ZZZ)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 ZZZ => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>R</c> component.
|
||||
/// </summary>
|
||||
public ref uint R => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(R)}");
|
||||
public ref uint R => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.x, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>G</c> component.
|
||||
/// </summary>
|
||||
public ref uint G => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(G)}");
|
||||
public ref uint G => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.y, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="uint"/> value representing the <c>B</c> component.
|
||||
/// </summary>
|
||||
public ref uint B => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(B)}");
|
||||
public ref uint B => ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.z, 1));
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 RR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 RR => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 RG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 RG => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 RB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 RB => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 GR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 GR => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 GG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 GG => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 GB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 GB => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 BR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 BR => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt2"/> value with the components <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref UInt2 BG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt2 BG => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt2"/> value with the components <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt2 BB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt2 BB => ref *(UInt2*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 RRR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 RRR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 RRG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 RRG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 RRB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 RRB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 RGR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 RGR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 RGG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 RGG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 RGB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 RGB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 RBR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 RBR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 RBG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 RBG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="R"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 RBB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(RBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 RBB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 GRR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 GRR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 GRG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 GRG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 GRB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 GRB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 GGR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 GGR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 GGG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 GGG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 GGB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 GGB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 GBR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 GBR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 GBG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 GBG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="G"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 GBB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(GBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 GBB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 BRR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BRR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 BRR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 BRG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BRG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 BRG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="R"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 BRB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BRB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 BRB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref UInt3 BGR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BGR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref UInt3 BGR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 BGG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BGG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 BGG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="G"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 BGB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BGB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 BGB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="R"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 BBR => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BBR)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 BBR => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="G"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 BBG => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BBG)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 BBG => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a readonly reference to the <see cref="UInt3"/> value with the components <see cref="B"/>, <see cref="B"/>, <see cref="B"/>.
|
||||
/// </summary>
|
||||
public ref readonly UInt3 BBB => throw new InvalidExecutionContextException($"{typeof(UInt3)}.{nameof(BBB)}");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref readonly UInt3 BBB => ref *(UInt3*)UndefinedData;
|
||||
|
||||
/// <summary>
|
||||
/// Sums two <see cref="UInt3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt3"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="UInt3"/> value to sum.</param>
|
||||
public static UInt3 operator +(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{typeof(UInt3)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt3 operator +(UInt3 left, UInt3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="UInt3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt3"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="UInt3"/> value to divide.</param>
|
||||
public static UInt3 operator /(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{typeof(UInt3)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt3 operator /(UInt3 left, UInt3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="UInt3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt3"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="UInt3"/> value to multiply.</param>
|
||||
public static UInt3 operator *(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{typeof(UInt3)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt3 operator *(UInt3 left, UInt3 right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="UInt3"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="UInt3"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="UInt3"/> value to subtract.</param>
|
||||
public static UInt3 operator -(UInt3 left, UInt3 right) => throw new InvalidExecutionContextException($"{typeof(UInt3)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static UInt3 operator -(UInt3 left, UInt3 right) => default;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -131,18 +130,21 @@ namespace ComputeSharp
|
||||
/// Casts a <see cref="UInt4"/> value to a <see cref="Int4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
|
||||
public static explicit operator Int4(UInt4 xyzw) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.({nameof(Int4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static explicit operator Int4(UInt4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="UInt4"/> value to a <see cref="Float4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
|
||||
public static implicit operator Float4(UInt4 xyzw) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.({nameof(Float4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Float4(UInt4 xyzw) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Casts a <see cref="UInt4"/> value to a <see cref="Double4"/> one.
|
||||
/// </summary>
|
||||
/// <param name="xyzw">The input <see cref="UInt4"/> value to cast.</param>
|
||||
public static implicit operator Double4(UInt4 xyzw) => throw new InvalidExecutionContextException($"{nameof(UInt4)}.({nameof(Double4)})");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static implicit operator Double4(UInt4 xyzw) => default;
|
||||
}
|
||||
}
|
||||
ファイル差分が大きすぎるため表示されません。
差分を読み込み
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -67,15 +67,25 @@ void GenerateVectorProperties(string typeName, int elementSize)
|
||||
int i = int.Parse(Regex.Match(typeName, @"\d+$").Value);
|
||||
#>
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Exceptions;
|
||||
#if NET5_0
|
||||
using System.Runtime.CompilerServices;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.SourceGenerators.Helpers.RuntimeHelpers;
|
||||
using MemoryMarshal = ComputeSharp.SourceGenerators.Helpers.MemoryMarshal;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <inheritdoc cref="<#=typeName#>"/>
|
||||
[StructLayout(LayoutKind.Explicit, Size = <#=(elementSize * i)#>, Pack = <#=elementSize#>)]
|
||||
public partial struct <#=typeName#>
|
||||
public unsafe partial struct <#=typeName#>
|
||||
{
|
||||
/// <summary>
|
||||
/// A private buffer to which the undefined properties will point to.
|
||||
/// </summary>
|
||||
private static readonly void* UndefinedData = (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(<#=typeName#>), sizeof(<#=typeName#>));
|
||||
<#
|
||||
WriteLine("");
|
||||
PushIndent(" ");
|
||||
PushIndent(" ");
|
||||
|
||||
@@ -94,7 +104,8 @@ namespace ComputeSharp
|
||||
/// Gets a reference to a specific component in the current <see cref="<#=typeName#>"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="i">The index of the component to access.</param>
|
||||
public ref <#=hlslElementTypeName#> this[int i] => throw new InvalidExecutionContextException($"{typeof(<#=typeName#>)}[{typeof(int)}]");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public ref <#=hlslElementTypeName#> this[int i] => ref *(<#=hlslElementTypeName#>*)UndefinedData;
|
||||
<#
|
||||
PushIndent(" ");
|
||||
PushIndent(" ");
|
||||
@@ -119,6 +130,13 @@ namespace ComputeSharp
|
||||
if (propertyName.Length == 1)
|
||||
{
|
||||
WriteLine($"/// Gets a reference to the <see cref=\"{propertyType}\"/> value representing the <c>{propertyName}</c> component.");
|
||||
WriteLine("/// </summary>");
|
||||
|
||||
char fieldName = "xyzw"["xyzwrgba".IndexOf(propertyName.ToLower()) % 4];
|
||||
|
||||
// Property
|
||||
Write($"public {refType} {propertyType} {propertyName} ");
|
||||
WriteLine($"=> ref MemoryMarshal.GetReference(MemoryMarshal.CreateSpan(ref this.{fieldName}, 1));");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -126,13 +144,14 @@ namespace ComputeSharp
|
||||
if (isReadonly) Write("readonly ");
|
||||
Write($"reference to the <see cref=\"{propertyType}\"/> value with the components ");
|
||||
Write(string.Join(", ", propertyName.Select(c => $"<see cref=\"{c}\"/>")));
|
||||
WriteLine(".");
|
||||
}
|
||||
WriteLine("/// </summary>");
|
||||
WriteLine(".");
|
||||
WriteLine("/// </summary>");
|
||||
WriteLine("/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>");
|
||||
|
||||
// Property
|
||||
Write($"public {refType} {propertyType} {propertyName} ");
|
||||
WriteLine($"=> throw new InvalidExecutionContextException($\"{{typeof({typeName})}}.{{nameof({propertyName})}}\");");
|
||||
// Property
|
||||
Write($"public {refType} {propertyType} {propertyName} ");
|
||||
WriteLine($"=> ref *({propertyType}*)UndefinedData;");
|
||||
}
|
||||
}
|
||||
|
||||
PopIndent();
|
||||
@@ -149,7 +168,8 @@ namespace ComputeSharp
|
||||
/// Negates a <see cref="<#=typeName#>"/> value.
|
||||
/// </summary>
|
||||
/// <param name="<#=argumentName#>">The <see cref="<#=typeName#>"/> value to negate.</param>
|
||||
public static <#=typeName#> operator -(<#=typeName#> <#=argumentName#>) => throw new InvalidExecutionContextException($"{typeof(<#=typeName#>)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=typeName#> operator -(<#=typeName#> <#=argumentName#>) => default;
|
||||
<#
|
||||
}
|
||||
|
||||
@@ -163,28 +183,32 @@ namespace ComputeSharp
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=typeName#>"/> value to sum.</param>
|
||||
/// <param name="right">The second <see cref="<#=typeName#>"/> value to sum.</param>
|
||||
public static <#=typeName#> operator +(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=typeName#>)}.+");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=typeName#> operator +(<#=typeName#> left, <#=typeName#> right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Divides two <see cref="<#=typeName#>"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=typeName#>"/> value to divide.</param>
|
||||
/// <param name="right">The second <see cref="<#=typeName#>"/> value to divide.</param>
|
||||
public static <#=typeName#> operator /(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=typeName#>)}./");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=typeName#> operator /(<#=typeName#> left, <#=typeName#> right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two <see cref="<#=typeName#>"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=typeName#>"/> value to multiply.</param>
|
||||
/// <param name="right">The second <see cref="<#=typeName#>"/> value to multiply.</param>
|
||||
public static <#=typeName#> operator *(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=typeName#>)}.*");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=typeName#> operator *(<#=typeName#> left, <#=typeName#> right) => default;
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two <see cref="<#=typeName#>"/> values.
|
||||
/// </summary>
|
||||
/// <param name="left">The first <see cref="<#=typeName#>"/> value to subtract.</param>
|
||||
/// <param name="right">The second <see cref="<#=typeName#>"/> value to subtract.</param>
|
||||
public static <#=typeName#> operator -(<#=typeName#> left, <#=typeName#> right) => throw new InvalidExecutionContextException($"{typeof(<#=typeName#>)}.-");
|
||||
/// <remarks>This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior.</remarks>
|
||||
public static <#=typeName#> operator -(<#=typeName#> left, <#=typeName#> right) => default;
|
||||
<#
|
||||
}
|
||||
#>
|
||||
|
||||
@@ -51,19 +51,23 @@ namespace ComputeSharp.Shaders.Renderer
|
||||
builder.AppendLine(define.Value);
|
||||
}
|
||||
|
||||
// Static constants
|
||||
if (info.ConstantsInfo.Count > 0)
|
||||
// Static fields
|
||||
if (info.StaticFields.Count > 0)
|
||||
{
|
||||
builder.AppendLine();
|
||||
|
||||
foreach (var constant in info.ConstantsInfo)
|
||||
foreach (var constant in info.StaticFields)
|
||||
{
|
||||
builder.Append("static const ");
|
||||
builder.Append(constant.Value.Type);
|
||||
builder.Append(constant.Value.TypeDeclaration);
|
||||
builder.Append(' ');
|
||||
builder.Append(constant.Key);
|
||||
builder.Append(" = ");
|
||||
builder.Append(constant.Value.Assignment);
|
||||
|
||||
if (constant.Value.Assignment is string assignment)
|
||||
{
|
||||
builder.Append(" = ");
|
||||
builder.Append(assignment);
|
||||
}
|
||||
|
||||
builder.AppendLine(";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ namespace ComputeSharp.Shaders.Translation
|
||||
IReadOnlyDictionary<string, string> DefinesInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of discovered constants.
|
||||
/// Gets the collection of discovered static fields.
|
||||
/// </summary>
|
||||
IReadOnlyDictionary<string, (string Type, string Assignment)> ConstantsInfo { get; }
|
||||
IReadOnlyDictionary<string, (string TypeDeclaration, string? Assignment)> StaticFields { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the collection of declared types for the shader.
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace ComputeSharp.Shaders.Translation
|
||||
public IReadOnlyCollection<string> DeclaredTypes => this.declaredTypes;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyDictionary<string, (string Type, string Assignment)> ConstantsInfo { get; private set; }
|
||||
public IReadOnlyDictionary<string, (string TypeDeclaration, string? Assignment)> StaticFields { get; private set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyDictionary<string, (string Type, int? Count)> SharedBuffers { get; private set; }
|
||||
@@ -146,7 +146,7 @@ namespace ComputeSharp.Shaders.Translation
|
||||
private void LoadMethodMetadata()
|
||||
{
|
||||
EntryPoint = Attribute.ExecuteMethod;
|
||||
ConstantsInfo = Attribute.Constants;
|
||||
StaticFields = Attribute.StaticFields;
|
||||
SharedBuffers = Attribute.SharedBuffers;
|
||||
|
||||
this.declaredTypes.AddRange(Attribute.Types);
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
[DataRow(nameof(GroupIds), "CMPS0007")]
|
||||
[DataRow(nameof(GroupSize), "CMPS0008")]
|
||||
[DataRow(nameof(GridIds), "CMPS0009")]
|
||||
[DataRow(nameof(DispatchSize), "CMPS0047")]
|
||||
[DataRow(nameof(DispatchSize), "CMPS0044")]
|
||||
public void InvalidDispatchInfoUsage_LocalFunction(string typeName, string diagnosticsId)
|
||||
{
|
||||
string source = $@"
|
||||
@@ -177,7 +177,7 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
[DataRow(nameof(GroupIds), "CMPS0007")]
|
||||
[DataRow(nameof(GroupSize), "CMPS0008")]
|
||||
[DataRow(nameof(GridIds), "CMPS0009")]
|
||||
[DataRow(nameof(DispatchSize), "CMPS0047")]
|
||||
[DataRow(nameof(DispatchSize), "CMPS0044")]
|
||||
public void InvalidDispatchInfoUsage_StaticMethod(string typeName, string diagnosticsId)
|
||||
{
|
||||
string source = $@"
|
||||
@@ -204,41 +204,6 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, diagnosticsId);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[DataRow(nameof(ThreadIds), "CMPS0006")]
|
||||
[DataRow(nameof(GroupIds), "CMPS0007")]
|
||||
[DataRow(nameof(GroupSize), "CMPS0008")]
|
||||
[DataRow(nameof(GridIds), "CMPS0009")]
|
||||
[DataRow(nameof(DispatchSize), "CMPS0047")]
|
||||
public void InvalidDispatchInfoUsage_ConstantProperty(string typeName, string diagnosticsId)
|
||||
{
|
||||
string source = $@"
|
||||
using ComputeSharp;
|
||||
|
||||
namespace ComputeSharp
|
||||
{{
|
||||
public class ReadWriteBuffer<T> {{ }}
|
||||
public static class {typeName} {{ public static int X => 0; }}
|
||||
}}
|
||||
|
||||
namespace MyFancyApp.Sample
|
||||
{{
|
||||
public struct MyShader : IComputeShader
|
||||
{{
|
||||
public ReadWriteBuffer<float> buffer;
|
||||
|
||||
private static int Foo => {typeName}.X;
|
||||
|
||||
public void Execute()
|
||||
{{
|
||||
buffer[0] = Foo;
|
||||
}}
|
||||
}}
|
||||
}}";
|
||||
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, diagnosticsId);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void InvalidThreadIdsNormalizedUsage()
|
||||
{
|
||||
@@ -257,11 +222,11 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
{{
|
||||
public ReadWriteBuffer<float> buffer;
|
||||
|
||||
private static int Foo => ThreadIds.Normalized.X;
|
||||
public static int Fail() => ThreadIds.Normalized.X;
|
||||
|
||||
public void Execute()
|
||||
{{
|
||||
buffer[0] = Foo;
|
||||
buffer[0] = Fail();
|
||||
}}
|
||||
}}
|
||||
}}";
|
||||
@@ -1206,7 +1171,7 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void InvalidShaderConstantPropertyType()
|
||||
public void InvalidShaderStaticFieldType()
|
||||
{
|
||||
string source = @"
|
||||
using ComputeSharp;
|
||||
@@ -1222,7 +1187,7 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
{
|
||||
public ReadWriteBuffer<float> buffer;
|
||||
|
||||
private static string Pi => ""Hello"";
|
||||
private static string Pi = ""Hello"";
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
@@ -1234,7 +1199,7 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void InvalidShaderConstantPropertyDeclaration_AutoProp()
|
||||
public void PropertyDeclaration_AutoProp()
|
||||
{
|
||||
string source = @"
|
||||
using ComputeSharp;
|
||||
@@ -1258,11 +1223,11 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
}
|
||||
}";
|
||||
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, "CMPS0044");
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, "CMPS0045");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void InvalidShaderConstantPropertyDeclaration_GetterBlock()
|
||||
public void PropertyDeclaration_GetterBlock()
|
||||
{
|
||||
string source = @"
|
||||
using ComputeSharp;
|
||||
@@ -1289,11 +1254,11 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
}
|
||||
}";
|
||||
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, "CMPS0044");
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, "CMPS0045");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NonReadonlyShaderPropertyDeclaration()
|
||||
public void StaticPropertyDeclaration()
|
||||
{
|
||||
string source = @"
|
||||
using ComputeSharp;
|
||||
@@ -1321,7 +1286,7 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void InstanceShaderPropertyDeclaration()
|
||||
public void InstancePropertyDeclaration()
|
||||
{
|
||||
string source = @"
|
||||
using ComputeSharp;
|
||||
@@ -1345,7 +1310,7 @@ namespace ComputeSharp.Tests.SourceGenerators
|
||||
}
|
||||
}";
|
||||
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, "CMPS0046");
|
||||
VerifyGeneratedDiagnostics<IComputeShaderSourceGenerator>(source, "CMPS0045");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -33,10 +33,10 @@ namespace ComputeSharp.Tests
|
||||
{
|
||||
public readonly ReadWriteBuffer<float> buffer;
|
||||
|
||||
static float Pi => 3.14f;
|
||||
static float SinPi => Hlsl.Sin(Pi);
|
||||
static Int2x2 Mat => new(1, 2, 3, 4);
|
||||
static float Combo => Hlsl.Abs(Hlsl.Clamp(Hlsl.Min(Hlsl.Max(3.14f, 2), 10), 0, 42));
|
||||
static readonly float Pi = 3.14f;
|
||||
static readonly float SinPi = Hlsl.Sin(Pi);
|
||||
static readonly Int2x2 Mat = new(1, 2, 3, 4);
|
||||
static readonly float Combo = Hlsl.Abs(Hlsl.Clamp(Hlsl.Min(Hlsl.Max(3.14f, 2), 10), 0, 42));
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
@@ -50,5 +50,39 @@ namespace ComputeSharp.Tests
|
||||
buffer[7] = Combo;
|
||||
}
|
||||
}
|
||||
|
||||
[CombinatorialTestMethod]
|
||||
[AllDevices]
|
||||
public void GlobalVariable(Device device)
|
||||
{
|
||||
using ReadWriteBuffer<int> buffer = device.Get().AllocateReadWriteBuffer<int>(32);
|
||||
|
||||
device.Get().For(32, new GlobalVariableShader(buffer));
|
||||
|
||||
int[] results = buffer.ToArray();
|
||||
|
||||
for (int i = 0; i < results.Length; i++)
|
||||
{
|
||||
Assert.AreEqual(results[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
[AutoConstructor]
|
||||
internal readonly partial struct GlobalVariableShader : IComputeShader
|
||||
{
|
||||
public readonly ReadWriteBuffer<int> buffer;
|
||||
|
||||
static int total;
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
for (int i = 0; i < ThreadIds.X; i++)
|
||||
{
|
||||
total++;
|
||||
}
|
||||
|
||||
buffer[ThreadIds.X] = total;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする