Remove unnecessary [Pure] attributes
このコミットが含まれているのは:
1 親
30fea918cf
コミット
4d51d8d05b
53ファイル変更
+70
-2093
検索条件に一致するファイルはありません
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -74,7 +73,6 @@ class Program
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the texture to load.</param>
|
||||
/// <returns>A texture with the data from the image at the specified name.</returns>
|
||||
[Pure]
|
||||
private static ReadOnlyTexture2D<Rgba32, float4> LoadTexture([CallerMemberName] string name = null!)
|
||||
{
|
||||
string filename = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Textures", $"{name}.png");
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using ComputeSharp.Core.Extensions;
|
||||
@@ -71,7 +70,6 @@ public sealed partial class ShaderMethodSourceAttribute : Attribute
|
||||
/// <param name="function">The input <see cref="Delegate"/> instance to get info for.</param>
|
||||
/// <param name="name">The name of the shader field containing <paramref name="function"/>.</param>
|
||||
/// <returns>The associated <see cref="ShaderMethodSourceAttribute"/> instance for the given delegate.</returns>
|
||||
[Pure]
|
||||
public static ShaderMethodSourceAttribute GetForDelegate(Delegate function, string name)
|
||||
{
|
||||
if (!function.Method.IsStatic)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Text;
|
||||
|
||||
namespace ComputeSharp.Exceptions;
|
||||
@@ -23,7 +22,6 @@ public sealed class HlslCompilationException : Exception
|
||||
/// </summary>
|
||||
/// <param name="error">The input compilatin error message from the DXC compiler.</param>
|
||||
/// <returns>A formatted error message for a new <see cref="HlslCompilationException"/> instance.</returns>
|
||||
[Pure]
|
||||
private static string GetExceptionMessage(string error)
|
||||
{
|
||||
StringBuilder builder = new(512);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.Core.Extensions;
|
||||
using ComputeSharp.Exceptions;
|
||||
@@ -84,7 +83,6 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
/// </summary>
|
||||
/// <param name="source">The HLSL source code to compile.</param>
|
||||
/// <returns>The bytecode for the compiled shader.</returns>
|
||||
[Pure]
|
||||
public ComPtr<IDxcBlob> CompileShader(ReadOnlySpan<char> source)
|
||||
{
|
||||
using ComPtr<IDxcBlobEncoding> dxcBlobEncoding = default;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ComputeSharp.SourceGenerators.Mappings;
|
||||
@@ -35,7 +34,6 @@ internal static class ISymbolExtensions
|
||||
/// </summary>
|
||||
/// <param name="symbol">The input <see cref="ITypeSymbol"/> instance.</param>
|
||||
/// <returns>The full metadata name for <paramref name="symbol"/>.</returns>
|
||||
[Pure]
|
||||
public static string GetFullMetadataName(this ITypeSymbol symbol)
|
||||
{
|
||||
static StringBuilder BuildFrom(ISymbol? symbol, StringBuilder builder)
|
||||
@@ -61,7 +59,6 @@ internal static class ISymbolExtensions
|
||||
/// <param name="symbol">The input <see cref="IMethodSymbol"/> instance.</param>
|
||||
/// <param name="includeParameters">Whether or not to also include parameter types.</param>
|
||||
/// <returns>The full metadata name for <paramref name="symbol"/>.</returns>
|
||||
[Pure]
|
||||
public static string GetFullMetadataName(this IMethodSymbol symbol, bool includeParameters = false)
|
||||
{
|
||||
if (includeParameters)
|
||||
@@ -79,7 +76,6 @@ internal static class ISymbolExtensions
|
||||
/// </summary>
|
||||
/// <param name="symbol">The input <see cref="IPropertySymbol"/> instance.</param>
|
||||
/// <returns>The full metadata name for <paramref name="symbol"/>.</returns>
|
||||
[Pure]
|
||||
public static string GetFullMetadataName(this IPropertySymbol symbol)
|
||||
{
|
||||
string declaringTypeName = symbol.ContainingType.GetFullMetadataName();
|
||||
@@ -99,7 +95,6 @@ internal static class ISymbolExtensions
|
||||
/// </summary>
|
||||
/// <param name="symbol">The input <see cref="IFieldSymbol"/> instance.</param>
|
||||
/// <returns>The full metadata name for <paramref name="symbol"/>.</returns>
|
||||
[Pure]
|
||||
public static string GetFullMetadataName(this IFieldSymbol symbol)
|
||||
{
|
||||
return $"{symbol.ContainingType.GetFullMetadataName()}.{symbol.Name}";
|
||||
@@ -110,7 +105,6 @@ internal static class ISymbolExtensions
|
||||
/// </summary>
|
||||
/// <param name="symbol">The symbol being processed.</param>
|
||||
/// <returns>A filename in the form "<SYMBOL_FULLNAME>"</returns>
|
||||
[Pure]
|
||||
public static string GetGeneratedFileName(this INamedTypeSymbol symbol)
|
||||
{
|
||||
return symbol.GetFullMetadataName().Replace('`', '-').Replace('+', '.');
|
||||
@@ -122,7 +116,6 @@ internal static class ISymbolExtensions
|
||||
/// <param name="typeSymbol">The input <see cref="ITypeSymbol"/> instance to process.</param>
|
||||
/// <param name="discoveredTypes">The collection of currently discovered types.</param>
|
||||
/// <returns>A <see cref="SyntaxNode"/> instance that represents a type compatible with HLSL.</returns>
|
||||
[Pure]
|
||||
public static TypeSyntax TrackType(this ITypeSymbol typeSymbol, ICollection<INamedTypeSymbol> discoveredTypes)
|
||||
{
|
||||
string typeName = typeSymbol.ToDisplayString(FullyQualifiedWithoutGlobalFormat);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics.Contracts;
|
||||
|
||||
|
||||
namespace ComputeSharp.SourceGenerators.Extensions;
|
||||
|
||||
/// <summary>
|
||||
@@ -12,7 +11,6 @@ internal static class StringExtensions
|
||||
/// </summary>
|
||||
/// <param name="text">The input <see cref="string"/> instance to convert.</param>
|
||||
/// <returns>An valid HLSL identifier name from <paramref name="text"/>.</returns>
|
||||
[Pure]
|
||||
public static string ToHlslIdentifierName(this string text)
|
||||
{
|
||||
return text.Replace('.', '_').Replace('+', '_');
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using ComputeSharp.SourceGenerators.Mappings;
|
||||
using Microsoft.CodeAnalysis;
|
||||
@@ -23,7 +22,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// <param name="semanticModel">The <see cref="SemanticModel"/> instance with info on the input tree.</param>
|
||||
/// <param name="discoveredTypes">The collection of currently discovered types.</param>
|
||||
/// <returns>A <see cref="SyntaxNode"/> instance that represents a type compatible with HLSL.</returns>
|
||||
[Pure]
|
||||
public static TRoot ReplaceAndTrackType<TRoot>(this TRoot node, SyntaxNode sourceType, SemanticModel semanticModel, ICollection<INamedTypeSymbol> discoveredTypes)
|
||||
where TRoot : TypeSyntax
|
||||
{
|
||||
@@ -40,7 +38,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// <param name="semanticModel">The <see cref="SemanticModel"/> instance with info on the input tree.</param>
|
||||
/// <param name="discoveredTypes">The collection of currently discovered types.</param>
|
||||
/// <returns>A <see cref="SyntaxNode"/> instance that represents a type compatible with HLSL.</returns>
|
||||
[Pure]
|
||||
public static TRoot ReplaceAndTrackType<TRoot>(this TRoot node, TypeSyntax targetType, SyntaxNode sourceType, SemanticModel semanticModel, ICollection<INamedTypeSymbol> discoveredTypes)
|
||||
where TRoot : SyntaxNode
|
||||
{
|
||||
@@ -85,7 +82,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// <param name="semanticModel">The <see cref="SemanticModel"/> instance with info on the input tree.</param>
|
||||
/// <param name="discoveredTypes">The collection of currently discovered types.</param>
|
||||
/// <returns>A <see cref="SyntaxNode"/> instance that represents a type compatible with HLSL.</returns>
|
||||
[Pure]
|
||||
public static TypeSyntax TrackType(this SyntaxNode node, SemanticModel semanticModel, ICollection<INamedTypeSymbol> discoveredTypes)
|
||||
{
|
||||
ITypeSymbol typeSymbol = semanticModel.GetTypeInfo(node).Type!;
|
||||
@@ -106,7 +102,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// </summary>
|
||||
/// <param name="node">The input <see cref="MethodDeclarationSyntax"/> node.</param>
|
||||
/// <returns>A node like the one in input, but always with a block body.</returns>
|
||||
[Pure]
|
||||
public static MethodDeclarationSyntax WithBlockBody(this MethodDeclarationSyntax node)
|
||||
{
|
||||
if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow)
|
||||
@@ -131,7 +126,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// </summary>
|
||||
/// <param name="node">The input <see cref="MethodDeclarationSyntax"/> node.</param>
|
||||
/// <returns>A node like the one in input, but just as a definition.</returns>
|
||||
[Pure]
|
||||
public static MethodDeclarationSyntax AsDefinition(this MethodDeclarationSyntax node)
|
||||
{
|
||||
if (node.ExpressionBody is ArrowExpressionClauseSyntax)
|
||||
@@ -151,7 +145,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// This method is the same as <see cref="WithBlockBody(MethodDeclarationSyntax)"/>, but it is necessary to
|
||||
/// duplicate the code because the two types don't have a common base type or interface that can be leveraged.
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static LocalFunctionStatementSyntax WithBlockBody(this LocalFunctionStatementSyntax node)
|
||||
{
|
||||
if (node.ExpressionBody is ArrowExpressionClauseSyntax arrow)
|
||||
@@ -176,7 +169,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// </summary>
|
||||
/// <param name="node">The input <see cref="LocalFunctionStatementSyntax"/> node.</param>
|
||||
/// <returns>A node like the one in input, but just as a definition.</returns>
|
||||
[Pure]
|
||||
public static LocalFunctionStatementSyntax AsDefinition(this LocalFunctionStatementSyntax node)
|
||||
{
|
||||
if (node.ExpressionBody is ArrowExpressionClauseSyntax)
|
||||
@@ -192,7 +184,6 @@ internal static class SyntaxNodeExtensions
|
||||
/// </summary>
|
||||
/// <param name="node">The input <see cref="MethodDeclarationSyntax"/> node.</param>
|
||||
/// <returns>A node just like <paramref name="node"/> but with no accessibility modifiers.</returns>
|
||||
[Pure]
|
||||
public static MethodDeclarationSyntax WithoutAccessibilityModifiers(this MethodDeclarationSyntax node)
|
||||
{
|
||||
return node.WithModifiers(TokenList(node.Modifiers.Where(static modifier => modifier.Kind() switch
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
@@ -23,7 +22,6 @@ internal static class SyntaxFactoryHelper
|
||||
/// </summary>
|
||||
/// <param name="groups">The input sequence of <see cref="string"/> groups.</param>
|
||||
/// <returns>An <see cref="ArrayCreationExpressionSyntax"/> instance with the described contents.</returns>
|
||||
[Pure]
|
||||
public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<(string A, string B)> groups)
|
||||
{
|
||||
return
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ComputeSharp.SourceGenerators.Diagnostics;
|
||||
@@ -98,7 +97,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="types">The collection of currently discovered types.</param>
|
||||
/// <param name="isComputeShader">Indicates whether or not <paramref name="structDeclarationSymbol"/> represents a compute shader.</param>
|
||||
/// <returns>A sequence of captured fields in <paramref name="structDeclarationSymbol"/>.</returns>
|
||||
[Pure]
|
||||
private static (
|
||||
ImmutableArray<(string MetadataName, string Name, string HlslType)>,
|
||||
ImmutableArray<(string Name, string HlslType)>)
|
||||
@@ -193,7 +191,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <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 fields in <paramref name="structDeclarationSymbol"/>.</returns>
|
||||
[Pure]
|
||||
private static ImmutableArray<(string Name, string TypeDeclaration, string? Assignment)> GetStaticFields(
|
||||
ImmutableArray<Diagnostic>.Builder diagnostics,
|
||||
SemanticModelProvider semanticModel,
|
||||
@@ -261,7 +258,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="structDeclarationSymbol">The input <see cref="INamedTypeSymbol"/> instance to process.</param>
|
||||
/// <param name="types">The collection of currently discovered types.</param>
|
||||
/// <returns>A sequence of captured members in <paramref name="structDeclarationSymbol"/>.</returns>
|
||||
[Pure]
|
||||
private static ImmutableArray<(string Name, string Type, int? Count)> GetSharedBuffers(
|
||||
ImmutableArray<Diagnostic>.Builder diagnostics,
|
||||
INamedTypeSymbol structDeclarationSymbol,
|
||||
@@ -323,7 +319,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="constantDefinitions">The collection of discovered constant definitions.</param>
|
||||
/// <param name="isComputeShader">Indicates whether or not <paramref name="structDeclarationSymbol"/> represents a compute shader.</param>
|
||||
/// <returns>A sequence of processed methods in <paramref name="structDeclaration"/>, and the entry point.</returns>
|
||||
[Pure]
|
||||
private static (string EntryPoint, ImmutableArray<(string Signature, string Definition)> Methods, bool IsSamplerUser) GetProcessedMethods(
|
||||
ImmutableArray<Diagnostic>.Builder diagnostics,
|
||||
StructDeclarationSyntax structDeclaration,
|
||||
@@ -418,7 +413,6 @@ public sealed partial class IShaderGenerator
|
||||
/// </summary>
|
||||
/// <param name="constantDefinitions">The collection of discovered constant definitions.</param>
|
||||
/// <returns>A sequence of discovered constants to declare in the shader.</returns>
|
||||
[Pure]
|
||||
internal static ImmutableArray<(string Name, string Value)> GetDefinedConstants(IReadOnlyDictionary<IFieldSymbol, string> constantDefinitions)
|
||||
{
|
||||
ImmutableArray<(string, string)>.Builder builder = ImmutableArray.CreateBuilder<(string, string)>(constantDefinitions.Count);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.Contracts;
|
||||
using ComputeSharp.__Internals;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
@@ -45,7 +44,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="delegateFieldNames">The names of all <see cref="System.Delegate"/> instance fields within the current shader type.</param>
|
||||
/// <param name="supportsDynamicShaders">Indicates whether or not dynamic shaders are supported.</param>
|
||||
/// <returns>The <see cref="BlockSyntax"/> instance to hash the input shader.</returns>
|
||||
[Pure]
|
||||
private static BlockSyntax GetShaderHashCodeBody(ImmutableArray<string> delegateFieldNames, bool supportsDynamicShaders)
|
||||
{
|
||||
if (delegateFieldNames.Length == 0 || !supportsDynamicShaders)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using Microsoft.CodeAnalysis;
|
||||
|
||||
@@ -18,7 +17,6 @@ public sealed partial class IShaderGenerator
|
||||
/// </summary>
|
||||
/// <param name="structDeclarationSymbol">The input <see cref="INamedTypeSymbol"/> instance to process.</param>
|
||||
/// <returns>The names of all <see cref="System.Delegate"/> instance fields within <paramref name="structDeclarationSymbol"/>.</returns>
|
||||
[Pure]
|
||||
public static ImmutableArray<string> GetInfo(INamedTypeSymbol structDeclarationSymbol)
|
||||
{
|
||||
return
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using ComputeSharp.__Internals;
|
||||
using ComputeSharp.SourceGenerators.Models;
|
||||
using Microsoft.CodeAnalysis;
|
||||
@@ -67,7 +66,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="supportsDynamicShaders">Indicates whether or not dynamic shaders are supported.</param>
|
||||
/// <param name="bytecodeLiterals">The resulting bytecode literals to insert into the final source code.</param>
|
||||
/// <returns>The <see cref="BlockSyntax"/> instance trying to retrieve the precompiled shader.</returns>
|
||||
[Pure]
|
||||
private static unsafe BlockSyntax GetShaderBytecodeBody(EmbeddedBytecodeInfo bytecodeInfo, bool supportsDynamicShaders, out string? bytecodeLiterals)
|
||||
{
|
||||
if (bytecodeInfo.Bytecode.IsEmpty)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Immutable;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -103,7 +102,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="hlslSource">The generated HLSL source code (ignoring captured delegates, if present).</param>
|
||||
/// <param name="diagnostic">The resulting diagnostic from the processing operation, if any.</param>
|
||||
/// <returns>The <see cref="ImmutableArray{T}"/> instance with the compiled shader bytecode.</returns>
|
||||
[Pure]
|
||||
public static unsafe ImmutableArray<byte> GetBytecode(
|
||||
ThreadIdsInfo threadIds,
|
||||
string hlslSource,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using ComputeSharp.SourceGenerators.Models;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
@@ -19,7 +18,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="iComputeShaderSymbol">The <see cref="INamedTypeSymbol"/> instance for <see cref="IComputeShader"/>.</param>
|
||||
/// <param name="iPixelShaderSymbol">The <see cref="INamedTypeSymbol"/> instance for <see cref="IPixelShader{TPixel}"/>.</param>
|
||||
/// <returns>Either <see cref="IComputeShader"/> or <see cref="IPixelShader{TPixel}"/>, or <see langword="null"/>.</returns>
|
||||
[Pure]
|
||||
private static Type? GetShaderType(
|
||||
INamedTypeSymbol typeSymbol,
|
||||
INamedTypeSymbol iComputeShaderSymbol,
|
||||
@@ -51,7 +49,6 @@ public sealed partial class IShaderGenerator
|
||||
/// <param name="methodDeclaration">The <see cref="MethodDeclarationSyntax"/> item to insert.</param>
|
||||
/// <param name="canUseSkipLocalsInit">Whether <c>[SkipLocalsInit]</c> can be used.</param>
|
||||
/// <returns>A <see cref="CompilationUnitSyntax"/> object wrapping <paramref name="methodDeclaration"/>.</returns>
|
||||
[Pure]
|
||||
private static CompilationUnitSyntax GetCompilationUnitFromMethod(
|
||||
HierarchyInfo hierarchyInfo,
|
||||
MethodDeclarationSyntax methodDeclaration,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using ComputeSharp.Core.Intrinsics.Attributes;
|
||||
@@ -19,7 +18,6 @@ internal static class HlslKnownKeywords
|
||||
/// <summary>
|
||||
/// Builds the mapping of all known HLSL keywords.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyCollection<string> BuildKnownKeywordsMap()
|
||||
{
|
||||
// HLSL keywords
|
||||
@@ -58,7 +56,6 @@ internal static class HlslKnownKeywords
|
||||
/// <param name="name">The input identifier name.</param>
|
||||
/// <param name="mapped">The mapped identifier name, if a replacement is needed.</param>
|
||||
/// <returns>The HLSL-compatible identifier name that can be used in an HLSL shader.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetMappedName(string name, out string? mapped)
|
||||
{
|
||||
mapped = KnownKeywords.Contains(name) switch
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
@@ -79,7 +78,6 @@ internal static class HlslKnownMembers
|
||||
/// <summary>
|
||||
/// Builds the mapping of supported known members to HLSL names.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownMembersMap()
|
||||
{
|
||||
Dictionary<string, string> knownMembers = new()
|
||||
@@ -325,7 +323,6 @@ internal static class HlslKnownMembers
|
||||
/// <summary>
|
||||
/// Builds the mapping of swizzled matrix indexer properties.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyCollection<string> BuildKnownMatrixIndexers()
|
||||
{
|
||||
return (
|
||||
@@ -347,7 +344,6 @@ internal static class HlslKnownMembers
|
||||
/// <summary>
|
||||
/// Builds the mapping of swizzled matrix indices.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyCollection<string> BuildKnownMatrixIndices()
|
||||
{
|
||||
return (
|
||||
@@ -360,7 +356,6 @@ internal static class HlslKnownMembers
|
||||
/// </summary>
|
||||
/// <param name="name">The input fully qualified member name.</param>
|
||||
/// <returns>Whether or not <paramref name="name"/> is a matrix swizzled indexer.</returns>
|
||||
[Pure]
|
||||
public static bool IsKnownMatrixIndexer(string name)
|
||||
{
|
||||
return KnownMatrixIndexers.Contains(name);
|
||||
@@ -371,7 +366,6 @@ internal static class HlslKnownMembers
|
||||
/// </summary>
|
||||
/// <param name="name">The input fully qualified member name.</param>
|
||||
/// <returns>Whether or not <paramref name="name"/> is a matrix swizzled index.</returns>
|
||||
[Pure]
|
||||
public static bool IsKnownMatrixIndex(string name)
|
||||
{
|
||||
return KnownMatrixIndices.Contains(name);
|
||||
@@ -383,7 +377,6 @@ internal static class HlslKnownMembers
|
||||
/// <param name="name">The input fully qualified member name.</param>
|
||||
/// <param name="mapped">The mapped name, if one is found.</param>
|
||||
/// <returns>The HLSL-compatible member name that can be used in an HLSL shader.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetMappedName(string name, out string? mapped)
|
||||
{
|
||||
return KnownMembers.TryGetValue(name, out mapped);
|
||||
@@ -395,7 +388,6 @@ internal static class HlslKnownMembers
|
||||
/// <param name="name">The input fully qualified indexer name.</param>
|
||||
/// <param name="mapped">The mapped type name, if one is found.</param>
|
||||
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader for the given indexer.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetMappedResourceIndexerTypeName(string name, out string? mapped)
|
||||
{
|
||||
return KnownResourceIndexers.TryGetValue(name, out mapped);
|
||||
@@ -407,7 +399,6 @@ internal static class HlslKnownMembers
|
||||
/// <param name="name">The input fully qualified indexer name.</param>
|
||||
/// <param name="mapped">The mapped type name, if one is found.</param>
|
||||
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader for the given sampler.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetMappedResourceSamplerAccessType(string name, out string? mapped)
|
||||
{
|
||||
return KnownResourceSamplers.TryGetValue(name, out mapped);
|
||||
@@ -420,7 +411,6 @@ internal static class HlslKnownMembers
|
||||
/// <param name="rank">The resulting indexer rank, if found.</param>
|
||||
/// <param name="axis">The resulting indexer axis, if found.</param>
|
||||
/// <returns>Whether or not a rank and axis could be resolved by the input indexer name.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis)
|
||||
{
|
||||
if (KnownSizeAccessors.TryGetValue(name, out var info))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
@@ -21,7 +20,6 @@ internal static class HlslKnownMethods
|
||||
/// <summary>
|
||||
/// Builds the mapping of supported known methods to HLSL names.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownMethodsMap()
|
||||
{
|
||||
Dictionary<string, string> knownMethods = new()
|
||||
@@ -148,7 +146,6 @@ internal static class HlslKnownMethods
|
||||
/// <param name="name">The input fully qualified method name.</param>
|
||||
/// <param name="mapped">The mapped name, if one is found.</param>
|
||||
/// <returns>The HLSL-compatible member name that can be used in an HLSL shader.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetMappedName(string name, out string? mapped)
|
||||
{
|
||||
return KnownMethods.TryGetValue(name, out mapped);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
@@ -20,7 +19,6 @@ internal static class HlslKnownSizes
|
||||
/// <summary>
|
||||
/// Builds the mapping of known type sizes and alignments.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyDictionary<string, (int, int)> BuildKnownSizesMap()
|
||||
{
|
||||
Dictionary<string, (int, int)> knownSizes = new()
|
||||
@@ -53,7 +51,6 @@ internal static class HlslKnownSizes
|
||||
/// </summary>
|
||||
/// <param name="typeName">The type name to get info for.</param>
|
||||
/// <returns>The size and and alignment for the input type.</returns>
|
||||
[Pure]
|
||||
public static (int Size, int Pack) GetTypeInfo(string typeName)
|
||||
{
|
||||
return KnownSizes[typeName];
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -73,7 +72,6 @@ internal static class HlslKnownTypes
|
||||
/// <summary>
|
||||
/// Builds the mapping of known primitive types.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
private static IReadOnlyDictionary<string, string> BuildKnownHlslTypes()
|
||||
{
|
||||
Dictionary<string, string> knownTypes = new()
|
||||
@@ -263,7 +261,6 @@ internal static class HlslKnownTypes
|
||||
/// </summary>
|
||||
/// <param name="typeSymbol">The input type to map.</param>
|
||||
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader.</returns>
|
||||
[Pure]
|
||||
public static string GetMappedName(INamedTypeSymbol typeSymbol)
|
||||
{
|
||||
// Delegate types just return an empty string, as they're not actually
|
||||
@@ -320,7 +317,6 @@ internal static class HlslKnownTypes
|
||||
/// </summary>
|
||||
/// <param name="typeSymbol">The pixel shader type to map.</param>
|
||||
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader.</returns>
|
||||
[Pure]
|
||||
public static string GetMappedNameForPixelShaderType(INamedTypeSymbol typeSymbol)
|
||||
{
|
||||
string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments.First()).GetFullMetadataName();
|
||||
@@ -340,7 +336,6 @@ internal static class HlslKnownTypes
|
||||
/// </summary>
|
||||
/// <param name="typeSymbol">The input type to map.</param>
|
||||
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader.</returns>
|
||||
[Pure]
|
||||
public static string GetMappedElementName(IArrayTypeSymbol typeSymbol)
|
||||
{
|
||||
string elementTypeName = ((INamedTypeSymbol)typeSymbol.ElementType).GetFullMetadataName();
|
||||
@@ -402,7 +397,6 @@ internal static class HlslKnownTypes
|
||||
/// </summary>
|
||||
/// <param name="types">The input collection of types to declare.</param>
|
||||
/// <returns>The same list as input, but in a valid HLSL declaration order.</returns>
|
||||
[Pure]
|
||||
private static IEnumerable<INamedTypeSymbol> OrderByDependency(IEnumerable<INamedTypeSymbol> types)
|
||||
{
|
||||
Queue<(INamedTypeSymbol Type, HashSet<INamedTypeSymbol> Fields)> queue = new();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.Contracts;
|
||||
using ComputeSharp.SourceGenerators.Extensions;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using static Microsoft.CodeAnalysis.SymbolDisplayTypeQualificationStyle;
|
||||
@@ -22,7 +21,6 @@ internal sealed record HierarchyInfo(string FilenameHint, string MetadataName, s
|
||||
/// </summary>
|
||||
/// <param name="typeSymbol">The input <see cref="INamedTypeSymbol"/> instance to gather info for.</param>
|
||||
/// <returns>A <see cref="HierarchyInfo"/> instance describing <paramref name="typeSymbol"/>.</returns>
|
||||
[Pure]
|
||||
public static HierarchyInfo From(INamedTypeSymbol typeSymbol)
|
||||
{
|
||||
ImmutableArray<string>.Builder names = ImmutableArray.CreateBuilder<string>();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ComputeSharp.__Internals;
|
||||
@@ -119,7 +118,6 @@ public sealed partial class ShaderMethodSourceGenerator : IIncrementalGenerator
|
||||
/// <param name="constantDefinitions">The collection of discovered constant definitions.</param>
|
||||
/// <param name="diagnostics">The resulting diagnostics from the processing operation.</param>
|
||||
/// <returns>A sequence of processed methods in <paramref name="methodDeclaration"/> (main method and all captured methods).</returns>
|
||||
[Pure]
|
||||
private static (string TargetMethod, ImmutableArray<(string Signature, string Definition)> DependentMethods) GetProcessedMethods(
|
||||
MethodDeclarationSyntax methodDeclaration,
|
||||
SemanticModelProvider semanticModel,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -15,7 +14,6 @@ public static class FloatExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Float2"/> <see cref="Span{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Vector2"/>, mapping the original <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static Span<Vector2> AsVector2(this Span<Float2> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Float2, Vector2>(span);
|
||||
@@ -26,7 +24,6 @@ public static class FloatExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Float2"/> <see cref="ReadOnlySpan{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Vector2"/>, mapping the original <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlySpan<Vector2> AsVector2(this ReadOnlySpan<Float2> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Float2, Vector2>(span);
|
||||
@@ -37,7 +34,6 @@ public static class FloatExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Float3"/> <see cref="Span{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Vector3"/>, mapping the original <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static Span<Vector3> AsVector3(this Span<Float3> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Float3, Vector3>(span);
|
||||
@@ -48,7 +44,6 @@ public static class FloatExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Float3"/> <see cref="ReadOnlySpan{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Vector3"/>, mapping the original <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlySpan<Vector3> AsVector3(this ReadOnlySpan<Float3> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Float3, Vector3>(span);
|
||||
@@ -59,7 +54,6 @@ public static class FloatExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector4"/> <see cref="Span{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Vector4"/>, mapping the original <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static Span<Vector4> AsVector4(this Span<Float4> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Float4, Vector4>(span);
|
||||
@@ -70,7 +64,6 @@ public static class FloatExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector4"/> <see cref="ReadOnlySpan{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Vector4"/>, mapping the original <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlySpan<Vector4> AsVector4(this ReadOnlySpan<Float4> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Float4, Vector4>(span);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ComputeSharp.Core.Extensions;
|
||||
@@ -14,7 +13,6 @@ internal static class MethodInfoExtensions
|
||||
/// </summary>
|
||||
/// <param name="method">The input <see cref="MethodInfo"/> instance.</param>
|
||||
/// <returns>A fully qualified name for <paramref name="method"/>, including parameters.</returns>
|
||||
[Pure]
|
||||
public static string GetFullName(this MethodInfo method)
|
||||
{
|
||||
var parameters = string.Join(", ", method.GetParameters().Select(static p => p.ParameterType.FullName));
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -15,7 +14,6 @@ public static class VectorExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector2"/> <see cref="Span{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Float2"/>, mapping the original <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static Span<Float2> AsFloat2(this Span<Vector2> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Vector2, Float2>(span);
|
||||
@@ -26,7 +24,6 @@ public static class VectorExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector2"/> <see cref="ReadOnlySpan{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Float2"/>, mapping the original <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlySpan<Float2> AsFloat2(this ReadOnlySpan<Vector2> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Vector2, Float2>(span);
|
||||
@@ -37,7 +34,6 @@ public static class VectorExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector3"/> <see cref="Span{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Float3"/>, mapping the original <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static Span<Float3> AsFloat3(this Span<Vector3> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Vector3, Float3>(span);
|
||||
@@ -48,7 +44,6 @@ public static class VectorExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector3"/> <see cref="ReadOnlySpan{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Float3"/>, mapping the original <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlySpan<Float3> AsFloat3(this ReadOnlySpan<Vector3> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Vector3, Float3>(span);
|
||||
@@ -59,7 +54,6 @@ public static class VectorExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector4"/> <see cref="Span{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Float4"/>, mapping the original <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static Span<Float4> AsFloat4(this Span<Vector4> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Vector4, Float4>(span);
|
||||
@@ -70,7 +64,6 @@ public static class VectorExtensions
|
||||
/// </summary>
|
||||
/// <param name="span">The input <see cref="Vector4"/> <see cref="ReadOnlySpan{T}"/>.</param>
|
||||
/// <returns>A <see cref="Span{T}"/> with items of type <see cref="Float4"/>, mapping the original <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlySpan<Float4> AsFloat4(this ReadOnlySpan<Vector4> span)
|
||||
{
|
||||
return MemoryMarshal.Cast<Vector4, Float4>(span);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ComputeSharp.Core.Helpers;
|
||||
|
||||
@@ -14,7 +13,6 @@ internal static class AlignmentHelper
|
||||
/// <param name="size">The input size to pad, if needed.</param>
|
||||
/// <param name="alignment">The target alignment.</param>
|
||||
/// <returns>The padded value relative to the given inputs.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int Pad(int size, int alignment)
|
||||
{
|
||||
@@ -27,7 +25,6 @@ internal static class AlignmentHelper
|
||||
/// <param name="size">The input size to pad, if needed.</param>
|
||||
/// <param name="alignment">The target alignment.</param>
|
||||
/// <returns>The padded value relative to the given inputs.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static nint Pad(nint size, nint alignment)
|
||||
{
|
||||
@@ -41,7 +38,6 @@ internal static class AlignmentHelper
|
||||
/// <param name="size">The size increment to apply to <paramref name="offset"/>.</param>
|
||||
/// <param name="alignment">The alignment boundary to calculate the final offset.</param>
|
||||
/// <returns>A valid starting offset for the specified alignment.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int AlignToBoundary(int offset, int size, int alignment)
|
||||
{
|
||||
|
||||
ファイル差分が大きすぎるため表示されません。
差分を読み込み
@@ -1,5 +1,4 @@
|
||||
<#@include file="Hlsl.ttinclude" #>
|
||||
using System.Diagnostics.Contracts;
|
||||
using ComputeSharp.Core.Intrinsics.Attributes;
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
@@ -38,7 +37,6 @@ foreach (var intrinsic in Intrinsics)
|
||||
|
||||
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}(");
|
||||
|
||||
@@ -80,8 +80,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Double4x2", Params = new[] { "Double4x2" } },
|
||||
new { Return = "Double4x3", Params = new[] { "Double4x3" } },
|
||||
new { Return = "Double4x4", Params = new[] { "Double4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -115,8 +114,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -190,8 +188,7 @@ var Intrinsics = new[]
|
||||
new { Return = "bool", Params = new[] { "Bool4x2" } },
|
||||
new { Return = "bool", Params = new[] { "Bool4x3" } },
|
||||
new { Return = "bool", Params = new[] { "Bool4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -265,8 +262,7 @@ var Intrinsics = new[]
|
||||
new { Return = "bool", Params = new[] { "Bool4x2" } },
|
||||
new { Return = "bool", Params = new[] { "Bool4x3" } },
|
||||
new { Return = "bool", Params = new[] { "Bool4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -283,8 +279,7 @@ var Intrinsics = new[]
|
||||
{
|
||||
new { Return = "double", Params = new[] { "uint", "uint" } },
|
||||
new { Return = "Double2", Params = new[] { "UInt2", "UInt2" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -338,8 +333,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "UInt4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "UInt4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "UInt4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -373,8 +367,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -428,8 +421,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Int4x2", Params = new[] { "UInt4x2" } },
|
||||
new { Return = "Int4x3", Params = new[] { "UInt4x3" } },
|
||||
new { Return = "Int4x4", Params = new[] { "UInt4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -483,8 +475,7 @@ var Intrinsics = new[]
|
||||
new { Return = "UInt4x2", Params = new[] { "Int4x2" } },
|
||||
new { Return = "UInt4x3", Params = new[] { "Int4x3" } },
|
||||
new { Return = "UInt4x4", Params = new[] { "Int4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -518,8 +509,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -554,8 +544,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -589,8 +578,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -646,8 +634,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2", "Int4x2" } },
|
||||
new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3", "Int4x3" } },
|
||||
new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4", "Int4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -681,8 +668,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -716,8 +702,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -735,8 +720,7 @@ var Intrinsics = new[]
|
||||
new { Return = "UInt2", Params = new[] { "UInt2" } },
|
||||
new { Return = "UInt3", Params = new[] { "UInt3" } },
|
||||
new { Return = "UInt4", Params = new[] { "UInt4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -752,8 +736,7 @@ var Intrinsics = new[]
|
||||
Overloads = new[]
|
||||
{
|
||||
new { Return = "Float3", Params = new[] { "Float3", "Float3" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -787,8 +770,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -806,8 +788,7 @@ var Intrinsics = new[]
|
||||
new { Return = "float", Params = new[] { "Float2x2" } },
|
||||
new { Return = "float", Params = new[] { "Float3x3" } },
|
||||
new { Return = "float", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -825,8 +806,7 @@ var Intrinsics = new[]
|
||||
new { Return = "float", Params = new[] { "Float2", "Float2" } },
|
||||
new { Return = "float", Params = new[] { "Float3", "Float3" } },
|
||||
new { Return = "float", Params = new[] { "Float4", "Float4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -847,8 +827,7 @@ var Intrinsics = new[]
|
||||
new { Return = "int", Params = new[] { "Int2", "Int2" } },
|
||||
new { Return = "int", Params = new[] { "Int3", "Int3" } },
|
||||
new { Return = "int", Params = new[] { "Int4", "Int4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -882,8 +861,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -917,8 +895,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -940,8 +917,7 @@ var Intrinsics = new[]
|
||||
new { Return = "UInt2", Params = new[] { "UInt2" } },
|
||||
new { Return = "UInt3", Params = new[] { "UInt3" } },
|
||||
new { Return = "UInt4", Params = new[] { "UInt4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -963,8 +939,7 @@ var Intrinsics = new[]
|
||||
new { Return = "UInt2", Params = new[] { "UInt2" } },
|
||||
new { Return = "UInt3", Params = new[] { "UInt3" } },
|
||||
new { Return = "UInt4", Params = new[] { "UInt4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -998,8 +973,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1035,8 +1009,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Double4x2", Params = new[] { "Double4x2", "Double4x2", "Double4x2" } },
|
||||
new { Return = "Double4x3", Params = new[] { "Double4x3", "Double4x3", "Double4x3" } },
|
||||
new { Return = "Double4x4", Params = new[] { "Double4x4", "Double4x4", "Double4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1071,8 +1044,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1106,8 +1078,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1142,8 +1113,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = false
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1177,8 +1147,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Bool4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Bool4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Bool4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1212,8 +1181,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Bool4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Bool4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Bool4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1247,8 +1215,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Bool4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Bool4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Bool4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1283,8 +1250,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1301,8 +1267,7 @@ var Intrinsics = new[]
|
||||
new { Return = "float", Params = new[] { "Float2" } },
|
||||
new { Return = "float", Params = new[] { "Float3" } },
|
||||
new { Return = "float", Params = new[] { "Float4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1338,8 +1303,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1373,8 +1337,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1408,8 +1371,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1443,8 +1405,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1519,8 +1480,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2" } },
|
||||
new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3" } },
|
||||
new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1595,8 +1555,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2" } },
|
||||
new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3" } },
|
||||
new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1651,8 +1610,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Int4x2", Params = new[] { "Int4x2", "Int4x2" } },
|
||||
new { Return = "Int4x3", Params = new[] { "Int4x3", "Int4x3" } },
|
||||
new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1944,8 +1902,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Int4x2", Params = new[] { "Int4x4", "Int4x2" } },
|
||||
new { Return = "Int4x3", Params = new[] { "Int4x4", "Int4x3" } },
|
||||
new { Return = "Int4x4", Params = new[] { "Int4x4", "Int4x4" } },
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1962,8 +1919,7 @@ var Intrinsics = new[]
|
||||
new { Return = "float", Params = new[] { "Float2" } },
|
||||
new { Return = "float", Params = new[] { "Float3" } },
|
||||
new { Return = "float", Params = new[] { "Float4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -1998,8 +1954,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2033,8 +1988,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2088,8 +2042,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Double4x2", Params = new[] { "Double4x2" } },
|
||||
new { Return = "Double4x3", Params = new[] { "Double4x3" } },
|
||||
new { Return = "Double4x4", Params = new[] { "Double4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2124,8 +2077,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2161,8 +2113,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2", "float" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3", "float" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4", "float" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2180,8 +2131,7 @@ var Intrinsics = new[]
|
||||
new { Return = "UInt2", Params = new[] { "UInt2" } },
|
||||
new { Return = "UInt3", Params = new[] { "UInt3" } },
|
||||
new { Return = "UInt4", Params = new[] { "UInt4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2215,8 +2165,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2250,8 +2199,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2305,8 +2253,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Double4x2", Params = new[] { "Double4x2" } },
|
||||
new { Return = "Double4x3", Params = new[] { "Double4x3" } },
|
||||
new { Return = "Double4x4", Params = new[] { "Double4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2360,8 +2307,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Int4x2", Params = new[] { "Int4x2" } },
|
||||
new { Return = "Int4x3", Params = new[] { "Int4x3" } },
|
||||
new { Return = "Int4x4", Params = new[] { "Int4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2395,8 +2341,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2432,8 +2377,7 @@ var Intrinsics = new[]
|
||||
new { Return = "void", Params = new[] { "Float4x2", "Float4x2", "Float4x2" } },
|
||||
new { Return = "void", Params = new[] { "Float4x3", "Float4x3", "Float4x3" } },
|
||||
new { Return = "void", Params = new[] { "Float4x4", "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2467,8 +2411,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2504,8 +2447,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2539,8 +2481,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2575,8 +2516,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2", "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3", "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4", "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2610,8 +2550,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2645,8 +2584,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2696,8 +2634,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Bool1x4", Params = new[] { "Bool4x1" } },
|
||||
new { Return = "Bool2x4", Params = new[] { "Bool4x2" } },
|
||||
new { Return = "Bool3x4", Params = new[] { "Bool4x3" } },
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
},
|
||||
new
|
||||
{
|
||||
@@ -2731,8 +2668,7 @@ var Intrinsics = new[]
|
||||
new { Return = "Float4x2", Params = new[] { "Float4x2" } },
|
||||
new { Return = "Float4x3", Params = new[] { "Float4x3" } },
|
||||
new { Return = "Float4x4", Params = new[] { "Float4x4" } }
|
||||
},
|
||||
IsPure = true
|
||||
}
|
||||
}
|
||||
};
|
||||
#>
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
@@ -113,7 +112,6 @@ internal unsafe ref struct CommandList
|
||||
/// Gets a pointer to the <see cref="ID3D12CommandList"/> object in use by the current instance.
|
||||
/// </summary>
|
||||
/// <returns>A double pointer to the current <see cref="ID3D12CommandList"/> object to execute.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly ID3D12CommandList** GetD3D12CommandListAddressOf()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Text;
|
||||
using ComputeSharp.Interop;
|
||||
using ComputeSharp.Resources;
|
||||
@@ -31,7 +30,6 @@ public sealed class GraphicsDeviceMismatchException : InvalidOperationException
|
||||
/// This method only takes a <see cref="NativeObject"/> instance and the associated <see cref="GraphicsDevice"/> instance as
|
||||
/// <see cref="object.GetType"/> will still be available, but without the unnecessary generic type specializations for the method.
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
private static GraphicsDeviceMismatchException Create(NativeObject resource, GraphicsDevice sourceDevice, GraphicsDevice destinationDevice)
|
||||
{
|
||||
StringBuilder builder = new(512);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Text;
|
||||
|
||||
namespace ComputeSharp.Exceptions;
|
||||
@@ -23,7 +22,6 @@ public sealed class UnsupportedDoubleOperationsException : InvalidOperationExcep
|
||||
/// </summary>
|
||||
/// <param name="type">The element type of resource that was being created.</param>
|
||||
/// <returns>A new <see cref="UnsupportedTextureTypeException"/> instance with a formatted error message.</returns>
|
||||
[Pure]
|
||||
private static UnsupportedDoubleOperationsException Create(Type type)
|
||||
{
|
||||
StringBuilder builder = new(256);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Text;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
@@ -25,7 +24,6 @@ public sealed class UnsupportedTextureTypeException : InvalidOperationException
|
||||
/// <param name="rank">The rank of the texture that couldn't be created.</param>
|
||||
/// <param name="type">The element type of texture that was being created.</param>
|
||||
/// <returns>A new <see cref="UnsupportedTextureTypeException"/> instance with a formatted error message.</returns>
|
||||
[Pure]
|
||||
private static UnsupportedTextureTypeException Create(int rank, Type type)
|
||||
{
|
||||
StringBuilder builder = new(256);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Resources;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
@@ -20,7 +19,6 @@ public static class BufferExtensions
|
||||
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
|
||||
/// <param name="source">The input <see cref="Buffer{T}"/> instance to read data from.</param>
|
||||
/// <returns>A <typeparamref name="T"/> array with the contents of the input buffer.</returns>
|
||||
[Pure]
|
||||
public static T[] ToArray<T>(this Buffer<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -35,7 +33,6 @@ public static class BufferExtensions
|
||||
/// <param name="offset">The offset to start reading data from.</param>
|
||||
/// <param name="count">The number of items to read.</param>
|
||||
/// <returns>A <typeparamref name="T"/> array with the contents of the specified range from the current buffer.</returns>
|
||||
[Pure]
|
||||
public static T[] ToArray<T>(this Buffer<T> source, int offset, int count)
|
||||
where T : unmanaged
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using ComputeSharp.__Internals;
|
||||
using ComputeSharp.Graphics.Helpers;
|
||||
@@ -21,7 +20,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="length">The length of the buffer to allocate.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ConstantBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
|
||||
[Pure]
|
||||
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -35,7 +33,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A constant <see cref="ConstantBuffer{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, T[] source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -49,7 +46,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A constant <see cref="ConstantBuffer{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -67,7 +63,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <see cref="Buffer{T}"/> with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A constant <see cref="ConstantBuffer{T}"/> instance with the contents of the input <see cref="Buffer{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, Buffer<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -86,7 +81,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="length">The length of the buffer to allocate.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadOnlyBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -100,7 +94,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A read write <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, T[] source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -114,7 +107,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A read write <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -132,7 +124,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <see cref="Buffer{T}"/> with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A read write <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input <see cref="Buffer{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, Buffer<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -152,7 +143,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadOnlyTexture2D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -168,7 +158,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, T[] source, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -185,7 +174,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -199,7 +187,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated texture.</param>
|
||||
/// <returns>A read write <see cref="ReadOnlyTexture2D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, T[,] source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -219,7 +206,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T> AllocateReadOnlyTexture2D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -240,7 +226,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> AllocateReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -258,7 +243,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> AllocateReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, T[] source, int width, int height)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -277,7 +261,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> AllocateReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, T[] source, int offset, int width, int height)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -293,7 +276,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated texture.</param>
|
||||
/// <returns>A read write <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> AllocateReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, T[,] source)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -315,7 +297,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> AllocateReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -337,7 +318,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadOnlyTexture3D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>, <paramref name="depth"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -354,7 +334,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture3D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, T[] source, int width, int height, int depth)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -372,7 +351,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture3D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -390,7 +368,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// The source 3D array needs to have each 2D plane stacked on the depth axis.
|
||||
/// That is, the expected layout of the input array has to be [depth, height, width].
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, T[,,] source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -411,7 +388,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture3D{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T> AllocateReadOnlyTexture3D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height, int depth)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -433,7 +409,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadOnlyTexture3D{T, TPixel}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>, <paramref name="depth"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T, TPixel> AllocateReadOnlyTexture3D<T, TPixel>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -452,7 +427,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture3D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T, TPixel> AllocateReadOnlyTexture3D<T, TPixel>(this GraphicsDevice device, T[] source, int width, int height, int depth)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -472,7 +446,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture3D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T, TPixel> AllocateReadOnlyTexture3D<T, TPixel>(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -492,7 +465,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// The source 3D array needs to have each 2D plane stacked on the depth axis.
|
||||
/// That is, the expected layout of the input array has to be [depth, height, width].
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T, TPixel> AllocateReadOnlyTexture3D<T, TPixel>(this GraphicsDevice device, T[,,] source)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -515,7 +487,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture3D{T, TPixel}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture3D<T, TPixel> AllocateReadOnlyTexture3D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height, int depth)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -535,7 +506,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="length">The length of the buffer to allocate.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadWriteBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -549,7 +519,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A read write <see cref="ReadWriteBuffer{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, T[] source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -563,7 +532,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A read write <see cref="ReadWriteBuffer{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -581,7 +549,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
|
||||
/// <param name="source">The input <see cref="Buffer{T}"/> with the data to copy on the allocated buffer.</param>
|
||||
/// <returns>A read write <see cref="ReadWriteBuffer{T}"/> instance with the contents of the input <see cref="Buffer{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, Buffer<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -601,7 +568,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadWriteTexture2D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -617,7 +583,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, T[] source, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -634,7 +599,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -648,7 +612,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated texture.</param>
|
||||
/// <returns>A read write <see cref="ReadWriteTexture2D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, T[,] source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -668,7 +631,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T> AllocateReadWriteTexture2D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -689,7 +651,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadWriteTexture2D{T, TPixel}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> AllocateReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -707,7 +668,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> AllocateReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, T[] source, int width, int height)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -726,7 +686,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> AllocateReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, T[] source, int offset, int width, int height)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -742,7 +701,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated texture.</param>
|
||||
/// <returns>A read write <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> AllocateReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, T[,] source)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -764,7 +722,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture.</param>
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> AllocateReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -786,7 +743,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A zeroed <see cref="ReadWriteTexture3D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -803,7 +759,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture3D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, T[] source, int width, int height, int depth)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -821,7 +776,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture3D{T}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -839,7 +793,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// The source 3D array needs to have each 2D plane stacked on the depth axis.
|
||||
/// That is, the expected layout of the input array has to be [depth, height, width].
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, T[,,] source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -860,7 +813,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture3D{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T> AllocateReadWriteTexture3D<T>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height, int depth)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -882,7 +834,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture3D{T, TPixel}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>, <paramref name="depth"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T, TPixel> AllocateReadWriteTexture3D<T, TPixel>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -901,7 +852,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture3D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T, TPixel> AllocateReadWriteTexture3D<T, TPixel>(this GraphicsDevice device, T[] source, int width, int height, int depth)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -921,7 +871,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture3D{T, TPixel}"/> instance with the contents of the input array.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T, TPixel> AllocateReadWriteTexture3D<T, TPixel>(this GraphicsDevice device, T[] source, int offset, int width, int height, int depth)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -941,7 +890,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// The source 3D array needs to have each 2D plane stacked on the depth axis.
|
||||
/// That is, the expected layout of the input array has to be [depth, height, width].
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T, TPixel> AllocateReadWriteTexture3D<T, TPixel>(this GraphicsDevice device, T[,,] source)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -964,7 +912,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture3D{T, TPixel}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture3D<T, TPixel> AllocateReadWriteTexture3D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<T> source, int width, int height, int depth)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -984,7 +931,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="length">The length of the buffer to allocate.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="ReadOnlyBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
|
||||
[Pure]
|
||||
public static UploadBuffer<T> AllocateUploadBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -1000,7 +946,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="UploadTexture2D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>].</returns>
|
||||
[Pure]
|
||||
public static UploadTexture2D<T> AllocateUploadTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -1017,7 +962,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="UploadTexture3D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>, <paramref name="depth"/>].</returns>
|
||||
[Pure]
|
||||
public static UploadTexture3D<T> AllocateUploadTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -1032,7 +976,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="length">The length of the buffer to allocate.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="ReadBackBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
|
||||
[Pure]
|
||||
public static ReadBackBuffer<T> AllocateReadBackBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -1048,7 +991,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="ReadBackTexture2D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadBackTexture2D<T> AllocateReadBackTexture2D<T>(this GraphicsDevice device, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -1065,7 +1007,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="ReadBackTexture3D{T}"/> instance of size [<paramref name="width"/>, <paramref name="height"/>, <paramref name="depth"/>].</returns>
|
||||
[Pure]
|
||||
public static ReadBackTexture3D<T> AllocateReadBackTexture3D<T>(this GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -1080,7 +1021,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> LoadReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, string filename)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -1098,7 +1038,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> LoadReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<char> filename)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -1120,7 +1059,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="span">The buffer with the image data to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> LoadReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<byte> span)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -1142,7 +1080,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="stream">The stream with the image data to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadOnlyTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadOnlyTexture2D<T, TPixel> LoadReadOnlyTexture2D<T, TPixel>(this GraphicsDevice device, Stream stream)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -1166,7 +1103,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> LoadReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, string filename)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -1184,7 +1120,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> LoadReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<char> filename)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -1206,7 +1141,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="span">The buffer with the image data to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> LoadReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, ReadOnlySpan<byte> span)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -1228,7 +1162,6 @@ public static partial class GraphicsDeviceExtensions
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="stream">The stream with the image data to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="ReadWriteTexture2D{T, TPixel}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static ReadWriteTexture2D<T, TPixel> LoadReadWriteTexture2D<T, TPixel>(this GraphicsDevice device, Stream stream)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
namespace ComputeSharp.Core.Extensions;
|
||||
@@ -80,7 +79,6 @@ internal static class ComPtrExtensions
|
||||
/// This method is meant to be used in a chained expression and it does not increment the reference
|
||||
/// count for the input pointer. Do not expose the return value of this extension to consumers.
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe ref readonly ComPtr<IUnknown> AsIUnknown<T>(this in ComPtr<T> ptr)
|
||||
#if NET6_0_OR_GREATER
|
||||
@@ -99,7 +97,6 @@ internal static class ComPtrExtensions
|
||||
/// <param name="ptr">The input <see cref="ComPtr{T}"/> instance to get the address for.</param>
|
||||
/// <returns>The raw pointer to the input <see cref="ComPtr{T}"/> instance.</returns>
|
||||
/// <remarks>This method is only valid when the current <see cref="ComPtr{T}"/> instance is on the stack or pinned.</remarks>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void** GetVoidAddressOf<T>(this in ComPtr<T> ptr)
|
||||
#if NET6_0_OR_GREATER
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
#if NET6_0_OR_GREATER
|
||||
using System.Runtime.CompilerServices;
|
||||
#endif
|
||||
@@ -590,7 +589,6 @@ internal static unsafe class ID3D12DeviceExtensions
|
||||
/// <param name="d3D12Device">The target <see cref="ID3D12Device"/> to use to check features for.</param>
|
||||
/// <param name="d3D12Feature">The type of features to check.</param>
|
||||
/// <returns>A <see typeparamref="TFeature"/> value with the features data.</returns>
|
||||
[Pure]
|
||||
public static unsafe TFeature CheckFeatureSupport<TFeature>(this ref ID3D12Device d3D12Device, D3D12_FEATURE d3D12Feature)
|
||||
where TFeature : unmanaged
|
||||
{
|
||||
@@ -608,7 +606,6 @@ internal static unsafe class ID3D12DeviceExtensions
|
||||
/// <param name="dxgiFormat">The <see cref="DXGI_FORMAT"/> type to check support for.</param>
|
||||
/// <param name="d3D12FormatSupport1">The resource type to check support for.</param>
|
||||
/// <returns>Whether or not the input device supports the requested format for the specified resource type.</returns>
|
||||
[Pure]
|
||||
public static unsafe bool IsDxgiFormatSupported(this ref ID3D12Device d3D12Device, DXGI_FORMAT dxgiFormat, D3D12_FORMAT_SUPPORT1 d3D12FormatSupport1)
|
||||
{
|
||||
D3D12_FEATURE_DATA_FORMAT_SUPPORT d3D12FeatureDataFormatSupport = default;
|
||||
@@ -625,7 +622,6 @@ internal static unsafe class ID3D12DeviceExtensions
|
||||
/// <param name="d3D12Device">The target <see cref="ID3D12Device"/> to use to check features for.</param>
|
||||
/// <param name="d3DShaderModel">The <see cref="D3D_SHADER_MODEL"/> value to check support for.</param>
|
||||
/// <returns>Whether or not the input device supports the requested shader model.</returns>
|
||||
[Pure]
|
||||
public static unsafe bool IsShaderModelSupported(this ref ID3D12Device d3D12Device, D3D_SHADER_MODEL d3DShaderModel)
|
||||
{
|
||||
D3D12_FEATURE_DATA_SHADER_MODEL d3D12ShaderModel = default;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Graphics.Helpers;
|
||||
@@ -20,7 +19,6 @@ public static class Texture2DExtensions
|
||||
/// <typeparam name="T">The type of items stored on the texture.</typeparam>
|
||||
/// <param name="source">The input <see cref="Texture2D{T}"/> instance to read data from.</param>
|
||||
/// <returns>A <typeparamref name="T"/> array with the contents of the current texture.</returns>
|
||||
[Pure]
|
||||
public static T[,] ToArray<T>(this Texture2D<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -41,7 +39,6 @@ public static class Texture2DExtensions
|
||||
/// <param name="width">The width of the memory area to copy.</param>
|
||||
/// <param name="height">The height of the memory area to copy.</param>
|
||||
/// <returns>A <typeparamref name="T"/> array with the contents of the current texture.</returns>
|
||||
[Pure]
|
||||
public static unsafe T[,] ToArray<T>(this Texture2D<T> source, int x, int y, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Resources;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
@@ -22,7 +21,6 @@ public static class Texture3DExtensions
|
||||
/// in the 3D volume represented by the texture is contiguous in memory, and planes are stacked in
|
||||
/// the depth dimension. This means that the resulting 3D array will have a size of [D, H, W].
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static T[,,] ToArray<T>(this Texture3D<T> source)
|
||||
where T : unmanaged
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Contracts;
|
||||
using ComputeSharp.Graphics.Helpers;
|
||||
|
||||
namespace ComputeSharp;
|
||||
@@ -29,7 +28,6 @@ partial class GraphicsDevice
|
||||
/// Creating a device is a relatively expensive operation, so consider using <see cref="QueryDevices"/> to be
|
||||
/// able to filter the existing adapters before creating a device from them, to reduce the system overhead.
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static IEnumerable<GraphicsDevice> EnumerateDevices()
|
||||
{
|
||||
return new DeviceHelper.DeviceQuery(null);
|
||||
@@ -46,7 +44,6 @@ partial class GraphicsDevice
|
||||
/// the current system, if any of them doesn't meet the minimum criteria, and that additional filtering might be done
|
||||
/// after the input predicate is invoked, so a match doesn't necessarily guarantee that that device will be returned.
|
||||
/// </remarks>
|
||||
[Pure]
|
||||
public static IEnumerable<GraphicsDevice> QueryDevices(Predicate<GraphicsDeviceInfo> predicate)
|
||||
{
|
||||
return new DeviceHelper.DeviceQuery(predicate);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using ComputeSharp.Core.Extensions;
|
||||
@@ -192,7 +191,6 @@ public sealed unsafe partial class GraphicsDevice : NativeObject
|
||||
/// Checks whether the current device supports double precision floating point operations in shaders.
|
||||
/// </summary>
|
||||
/// <returns>Whether the current device supports double precision floating point operations in shaders.</returns>
|
||||
[Pure]
|
||||
public bool IsDoublePrecisionSupportAvailable()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
@@ -208,7 +206,6 @@ public sealed unsafe partial class GraphicsDevice : NativeObject
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of values to check support for.</typeparam>
|
||||
/// <returns>Whether <see cref="ReadOnlyTexture2D{T}"/> instances can be created by the current device.</returns>
|
||||
[Pure]
|
||||
public bool IsReadOnlyTexture2DSupportedForType<T>()
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -223,7 +220,6 @@ public sealed unsafe partial class GraphicsDevice : NativeObject
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of values to check support for.</typeparam>
|
||||
/// <returns>Whether <see cref="ReadWriteTexture2D{T}"/> instances can be created by the current device.</returns>
|
||||
[Pure]
|
||||
public bool IsReadWriteTexture2DSupportedForType<T>()
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -240,7 +236,6 @@ public sealed unsafe partial class GraphicsDevice : NativeObject
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of values to check support for.</typeparam>
|
||||
/// <returns>Whether <see cref="ReadOnlyTexture3D{T}"/> instances can be created by the current device.</returns>
|
||||
[Pure]
|
||||
public bool IsReadOnlyTexture3DSupportedForType<T>()
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -255,7 +250,6 @@ public sealed unsafe partial class GraphicsDevice : NativeObject
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of values to check support for.</typeparam>
|
||||
/// <returns>Whether <see cref="ReadWriteTexture3D{T}"/> instances can be created by the current device.</returns>
|
||||
[Pure]
|
||||
public bool IsReadWriteTexture3DSupportedForType<T>()
|
||||
where T : unmanaged
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using TerraFX.Interop.DirectX;
|
||||
@@ -18,7 +17,6 @@ internal static class DXGIFormatHelper
|
||||
/// <typeparam name="T">The input type argument to get the corresponding <see cref="DXGI_FORMAT"/> for.</typeparam>
|
||||
/// <returns>The <see cref="DXGI_FORMAT"/> value corresponding to <typeparamref name="T"/>.</returns>
|
||||
/// <exception cref="System.ArgumentException">Thrown when the input type <typeparamref name="T"/> is not supported.</exception>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static DXGI_FORMAT GetForType<T>()
|
||||
where T : unmanaged
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using ComputeSharp.Core.Extensions;
|
||||
using ComputeSharp.Graphics.Extensions;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
@@ -38,7 +37,6 @@ internal static partial class DeviceHelper
|
||||
/// </summary>
|
||||
/// <returns>The <see cref="Luid"/> of the default device supporting <see cref="D3D_FEATURE_LEVEL_11_0"/> and <see cref="D3D_SHADER_MODEL_6_0"/>.</returns>
|
||||
/// <remarks>This methods assumes that a default device is available.</remarks>
|
||||
[Pure]
|
||||
public static unsafe Luid GetDefaultDeviceLuid()
|
||||
{
|
||||
if (DefaultFactory.IsValueCreated)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Reflection;
|
||||
|
||||
namespace ComputeSharp.Graphics.Helpers;
|
||||
@@ -21,7 +20,6 @@ internal static class TypeInfo<T>
|
||||
/// </summary>
|
||||
/// <param name="type">The current type to check.</param>
|
||||
/// <returns>Whether or not <paramref name="type"/> is <see cref="double"/> or contains a <see cref="double"/> field.</returns>
|
||||
[Pure]
|
||||
private static bool ChecksIsDoubleOrContainsDoubles(Type type)
|
||||
{
|
||||
if (type == typeof(double)) return true;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using TerraFX.Interop.Windows;
|
||||
@@ -22,7 +21,6 @@ internal static class WICFormatHelper
|
||||
/// <typeparam name="T">The input type argument to get the corresponding WIC format <see cref="Guid"/>.</typeparam>
|
||||
/// <returns>The WIC format <see cref="Guid"/> value corresponding to <typeparamref name="T"/>.</returns>
|
||||
/// <exception cref="ArgumentException">Thrown when the input type <typeparamref name="T"/> is not supported.</exception>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Guid GetForType<T>()
|
||||
where T : unmanaged
|
||||
@@ -41,7 +39,6 @@ internal static class WICFormatHelper
|
||||
/// <typeparam name="T">The input type argument to get the corresponding WIC format <see cref="Guid"/>.</typeparam>
|
||||
/// <returns>The WIC format <see cref="Guid"/> value corresponding to <typeparamref name="T"/>.</returns>
|
||||
/// <exception cref="ArgumentException">Thrown when the input type <typeparamref name="T"/> is not supported.</exception>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool TryGetIntermediateFormatForType<T>(Guid containerFormat, out Guid intermediateFormat)
|
||||
where T : unmanaged
|
||||
@@ -114,7 +111,6 @@ internal static class WICFormatHelper
|
||||
/// <param name="filename">The target filename to get the container format for.</param>
|
||||
/// <returns>The WIC format container <see cref="Guid"/> value matching <paramref name="filename"/>.</returns>
|
||||
/// <exception cref="ArgumentException">Thrown when the input filename doesn't have a valid file extension.</exception>
|
||||
[Pure]
|
||||
public static Guid GetForFilename(ReadOnlySpan<char> filename)
|
||||
{
|
||||
return Path.GetExtension(filename).ToString() switch
|
||||
@@ -139,7 +135,6 @@ internal static class WICFormatHelper
|
||||
/// <param name="format">The target format to get the container format for.</param>
|
||||
/// <returns>The WIC format container <see cref="Guid"/> value matching <paramref name="format"/>.</returns>
|
||||
/// <exception cref="ArgumentException">Thrown when the input format isn't valid.</exception>
|
||||
[Pure]
|
||||
public static Guid GetForFormat(ImageFormat format)
|
||||
{
|
||||
return format switch
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Buffers;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.Core.Extensions;
|
||||
@@ -59,7 +58,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
/// <returns>An <see cref="UploadTexture2D{T}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public UploadTexture2D<T> LoadTexture<T>(GraphicsDevice device, ReadOnlySpan<char> filename)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -86,7 +84,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="span">The buffer with the image data to load and decode into the texture.</param>
|
||||
/// <returns>An <see cref="UploadTexture2D{T}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public UploadTexture2D<T> LoadTexture<T>(GraphicsDevice device, ReadOnlySpan<byte> span)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -117,7 +114,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="stream">The stream with the image data to load and decode into the texture.</param>
|
||||
/// <returns>An <see cref="UploadTexture2D{T}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public UploadTexture2D<T> LoadTexture<T>(GraphicsDevice device, Stream stream)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -144,7 +140,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the texture.</param>
|
||||
/// <param name="wicBitmapDecoder">The <see cref="IWICBitmapDecoder"/> object in use.</param>
|
||||
/// <returns>An <see cref="UploadTexture2D{T}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
private UploadTexture2D<T> LoadTexture<T>(GraphicsDevice device, IWICBitmapDecoder* wicBitmapDecoder)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -220,7 +215,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <typeparam name="T">The type of items to store in the texture.</typeparam>
|
||||
/// <param name="texture">The target <see cref="TextureView2D{T}"/> instance to write data to.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
[Pure]
|
||||
public void LoadTexture<T>(TextureView2D<T> texture, ReadOnlySpan<char> filename)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -245,7 +239,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <typeparam name="T">The type of items to store in the texture.</typeparam>
|
||||
/// <param name="texture">The target <see cref="TextureView2D{T}"/> instance to write data to.</param>
|
||||
/// <param name="span">The buffer with the image data to load and decode into the texture.</param>
|
||||
[Pure]
|
||||
public void LoadTexture<T>(TextureView2D<T> texture, ReadOnlySpan<byte> span)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -275,7 +268,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <typeparam name="T">The type of items to store in the texture.</typeparam>
|
||||
/// <param name="texture">The target <see cref="TextureView2D{T}"/> instance to write data to.</param>
|
||||
/// <param name="stream">The stream with the image data to load and decode into the texture.</param>
|
||||
[Pure]
|
||||
public void LoadTexture<T>(TextureView2D<T> texture, Stream stream)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -301,7 +293,6 @@ internal sealed unsafe class WICHelper
|
||||
/// <typeparam name="T">The type of items to store in the texture.</typeparam>
|
||||
/// <param name="texture">The target <see cref="TextureView2D{T}"/> instance to write data to.</param>
|
||||
/// <param name="wicBitmapDecoder">The <see cref="IWICBitmapDecoder"/> object in use.</param>
|
||||
[Pure]
|
||||
private void LoadTexture<T>(TextureView2D<T> texture, IWICBitmapDecoder* wicBitmapDecoder)
|
||||
where T : unmanaged
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
@@ -30,7 +29,6 @@ public readonly struct Luid : IEquatable<Luid>
|
||||
/// </summary>
|
||||
/// <param name="luid">The input <see cref="LUID"/> value.</param>
|
||||
/// <returns>A <see cref="Luid"/> instance with the same value.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static unsafe Luid FromLUID(LUID luid)
|
||||
{
|
||||
@@ -38,7 +36,6 @@ public readonly struct Luid : IEquatable<Luid>
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(Luid other)
|
||||
{
|
||||
@@ -48,14 +45,12 @@ public readonly struct Luid : IEquatable<Luid>
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[Pure]
|
||||
public override bool Equals(object? other)
|
||||
{
|
||||
return other is Luid luid && Equals(luid);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
@@ -63,7 +58,6 @@ public readonly struct Luid : IEquatable<Luid>
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[Pure]
|
||||
public override string ToString()
|
||||
{
|
||||
return (((long)this.highPart) << 32 | this.lowPart).ToString();
|
||||
@@ -71,7 +65,6 @@ public readonly struct Luid : IEquatable<Luid>
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
[Pure]
|
||||
public string ToString(string? format, IFormatProvider? formatProvider)
|
||||
{
|
||||
return (((long)this.highPart) << 32 | this.lowPart).ToString(format, formatProvider);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.Core.Helpers;
|
||||
using ComputeSharp.Exceptions;
|
||||
@@ -49,7 +48,6 @@ public sealed class ConstantBuffer<T> : Buffer<T>
|
||||
/// <summary>
|
||||
/// Gets the right padded size for <typeparamref name="T"/> elements to store in the current instance.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static unsafe int GetPaddedSize()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
@@ -284,7 +283,6 @@ public readonly unsafe ref partial struct TextureView2D<T>
|
||||
/// Returns a reference to the first element within the current instance, with no bounds check.
|
||||
/// </summary>
|
||||
/// <returns>A reference to the first element within the current instance.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public T* DangerousGetAddressAndByteStride(out int strideInBytes)
|
||||
{
|
||||
@@ -299,7 +297,6 @@ public readonly unsafe ref partial struct TextureView2D<T>
|
||||
/// <param name="y">The index of the target row to retrieve.</param>
|
||||
/// <exception cref="ArgumentOutOfRangeException">Throw when <paramref name="y"/> is out of range.</exception>
|
||||
/// <returns>The resulting row <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public Span<T> GetRowSpan(int y)
|
||||
{
|
||||
Guard.IsInRange(y, 0, this.height, nameof(y));
|
||||
@@ -330,7 +327,6 @@ public readonly unsafe ref partial struct TextureView2D<T>
|
||||
/// Copies the contents of the current <see cref="TextureView2D{T}"/> instance into a new 2D array.
|
||||
/// </summary>
|
||||
/// <returns>A 2D array containing the data in the current <see cref="TextureView2D{T}"/> instance.</returns>
|
||||
[Pure]
|
||||
public T[,] ToArray()
|
||||
{
|
||||
T[,] array = new T[this.height, this.width];
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
|
||||
@@ -320,7 +319,6 @@ public readonly unsafe ref partial struct TextureView3D<T>
|
||||
/// Returns a reference to the first element within the current instance, with no bounds check.
|
||||
/// </summary>
|
||||
/// <returns>A reference to the first element within the current instance.</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public T* DangerousGetAddressAndByteStride(out int strideInBytes)
|
||||
{
|
||||
@@ -338,7 +336,6 @@ public readonly unsafe ref partial struct TextureView3D<T>
|
||||
/// Throw when either <paramref name="y"/> or <paramref name="z"/> are out of range.
|
||||
/// </exception>
|
||||
/// <returns>The resulting row <see cref="Span{T}"/>.</returns>
|
||||
[Pure]
|
||||
public Span<T> GetRowSpan(int y, int z)
|
||||
{
|
||||
Guard.IsInRange(y, 0, this.height, nameof(y));
|
||||
@@ -370,7 +367,6 @@ public readonly unsafe ref partial struct TextureView3D<T>
|
||||
/// Copies the contents of the current <see cref="TextureView3D{T}"/> instance into a new 3D array.
|
||||
/// </summary>
|
||||
/// <returns>A 3D array containing the data in the current <see cref="TextureView3D{T}"/> instance.</returns>
|
||||
[Pure]
|
||||
public T[,,] ToArray()
|
||||
{
|
||||
T[,,] array = new T[this.depth, this.height, this.width];
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Buffers;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ComputeSharp.__Internals;
|
||||
@@ -30,7 +29,6 @@ public ref struct ArrayPoolStringBuilder
|
||||
/// </summary>
|
||||
/// <param name="sizeHint">The size hint for the internal buffer to allocate.</param>
|
||||
/// <returns>A new <see cref="ArrayPoolStringBuilder"/> instance with default values.</returns>
|
||||
[Pure]
|
||||
public static ArrayPoolStringBuilder Create(int sizeHint)
|
||||
{
|
||||
ArrayPoolStringBuilder builder;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.__Internals;
|
||||
|
||||
@@ -31,7 +30,6 @@ internal readonly unsafe struct DebugDispatchDataLoader : IDispatchDataLoader
|
||||
/// Creates a new <see cref="DebugDispatchDataLoader"/> instance.
|
||||
/// </summary>
|
||||
/// <returns>A new <see cref="DebugDispatchDataLoader"/> instance to use.</returns>
|
||||
[Pure]
|
||||
public static DebugDispatchDataLoader Create()
|
||||
{
|
||||
DebugDispatchDataLoader @this = default;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using ComputeSharp.__Internals;
|
||||
using ComputeSharp.Resources;
|
||||
@@ -22,7 +21,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="length">The length of the buffer to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="Buffer{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static Buffer<T> AllocateBuffer<T>(this GraphicsDevice device, Type type, int length, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -45,7 +43,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static Texture2D<T> AllocateTexture2D<T>(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -68,7 +65,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static Texture2D<T> AllocateTexture2D<T, TPixel>(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -92,7 +88,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static Texture3D<T> AllocateTexture3D<T>(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -116,7 +111,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="Texture3D{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static Texture3D<T> AllocateTexture3D<T, TPixel>(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -138,7 +132,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="length">The length of the buffer to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="TransferBuffer{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static TransferBuffer<T> AllocateTransferBuffer<T>(this GraphicsDevice device, Type type, int length, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -160,7 +153,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="TransferTexture2D{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static TransferTexture2D<T> AllocateTransferTexture2D<T>(this GraphicsDevice device, Type type, int width, int height, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -183,7 +175,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="depth">The depth of the texture to create.</param>
|
||||
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
|
||||
/// <returns>A <see cref="TransferTexture3D{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static TransferTexture3D<T> AllocateTransferTexture3D<T>(this GraphicsDevice device, Type type, int width, int height, int depth, AllocationMode allocationMode = AllocationMode.Default)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -203,7 +194,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="type">The type of buffer to allocate.</param>
|
||||
/// <param name="data">The data to load on the buffer.</param>
|
||||
/// <returns>A <see cref="Buffer{T}"/> instance of the requested type.</returns>
|
||||
[Pure]
|
||||
public static Buffer<T> AllocateBuffer<T>(this GraphicsDevice device, Type type, T[] data)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -226,7 +216,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="width">The width of the texture to create.</param>
|
||||
/// <param name="height">The height of the texture to create.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance of the requested type.</returns>
|
||||
[Pure]
|
||||
public static Texture2D<T> AllocateTexture2D<T>(this GraphicsDevice device, Type type, T[] data, int width, int height)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -249,7 +238,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="height">The height of the texture to create.</param>
|
||||
/// <param name="depth">The depth of the texture to create.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance of the requested type.</returns>
|
||||
[Pure]
|
||||
public static Texture3D<T> AllocateTexture3D<T>(this GraphicsDevice device, Type type, T[] data, int width, int height, int depth)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -269,7 +257,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="type">The type of texture to allocate.</param>
|
||||
/// <param name="data">The input 3D array to use as source data for the texture.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance of the requested size.</returns>
|
||||
[Pure]
|
||||
public static Texture3D<T> AllocateTexture3D<T>(this GraphicsDevice device, Type type, T[,,] data)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -289,7 +276,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="type">The type of buffer to allocate.</param>
|
||||
/// <param name="data">The data to load on the buffer.</param>
|
||||
/// <returns>A <see cref="Buffer{T}"/> instance of the requested type.</returns>
|
||||
[Pure]
|
||||
public static Buffer<T> AllocateBuffer<T>(this GraphicsDevice device, Type type, Buffer<T> data)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -309,7 +295,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="texture">The target <see cref="UploadTexture2D{T}"/> instance.</param>
|
||||
/// <param name="inputType">The type of filepath to use.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
[Pure]
|
||||
public static void Load<T>(this UploadTexture2D<T> texture, Type inputType, string filename)
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -336,7 +321,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="inputType">The type of filepath to use.</param>
|
||||
/// <param name="filename">The filename of the image file to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance with the contents of the specified file.</returns>
|
||||
[Pure]
|
||||
public static Texture2D<T> LoadTexture2D<T, TPixel>(this GraphicsDevice device, Type textureType, Type inputType, string filename)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -368,7 +352,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="type">The type of texture to allocate.</param>
|
||||
/// <param name="buffer">The buffer with the image data to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance with the contents of the specified buffer.</returns>
|
||||
[Pure]
|
||||
public static Texture2D<T> LoadTexture2D<T, TPixel>(this GraphicsDevice device, Type type, byte[] buffer)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
@@ -390,7 +373,6 @@ public static class GraphicsDeviceExtensions
|
||||
/// <param name="type">The type of texture to allocate.</param>
|
||||
/// <param name="stream">The stream with the image data to load and decode into the texture.</param>
|
||||
/// <returns>A <see cref="Texture2D{T}"/> instance with the contents of the specified stream.</returns>
|
||||
[Pure]
|
||||
public static Texture2D<T> LoadTexture2D<T, TPixel>(this GraphicsDevice device, Type type, Stream stream)
|
||||
where T : unmanaged, IUnorm<TPixel>
|
||||
where TPixel : unmanaged
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Resources;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
@@ -21,7 +20,6 @@ public static class ImagingExtensions
|
||||
/// <typeparam name="TTo">The target pixel format for the returned image.</typeparam>
|
||||
/// <param name="texture">The source <see cref="Texture2D{T}"/> instance to read data from.</param>
|
||||
/// <returns>An image with the data from the input texture.</returns>
|
||||
[Pure]
|
||||
public static unsafe Image<TTo> ToImage<TFrom, TTo>(this Texture2D<TFrom> texture)
|
||||
where TFrom : unmanaged
|
||||
where TTo : unmanaged, IPixel<TTo>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする