Add GetPixelShaderEffectRegistrationBlob<T> APIs
このコミットが含まれているのは:
1 親
993308f6e0
コミット
f6282f53ff
4ファイル変更
+390
-3
検索条件に一致するファイルはありません
@@ -9,6 +9,7 @@
|
||||
<Import_RootNamespace>ComputeSharp.D2D1.NetStandard</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Buffers\BitOperations.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\DoesNotReturnAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Math.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeHelpers.cs" />
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ComputeSharp.D2D1.NetStandard.System.Buffers;
|
||||
|
||||
/// <summary>
|
||||
/// A polyfill type that mirrors some methods from <see cref="BitOperations"/> on .NET 6.
|
||||
/// </summary>
|
||||
internal static class BitOperations
|
||||
{
|
||||
/// <summary>
|
||||
/// Rounds the given integral value up to a power of 2.
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns>
|
||||
/// The smallest power of 2 which is greater than or equal to <paramref name="value"/>.
|
||||
/// If <paramref name="value"/> is 0 or the result overflows, returns 0.
|
||||
/// </returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint RoundUpToPowerOf2(uint value)
|
||||
{
|
||||
// Based on https://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
|
||||
--value;
|
||||
|
||||
value |= value >> 1;
|
||||
value |= value >> 2;
|
||||
value |= value >> 4;
|
||||
value |= value >> 8;
|
||||
value |= value >> 16;
|
||||
|
||||
return value + 1;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする