Bump D3D12MA to version 2.0.0-beta3.1463073211

このコミットが含まれているのは:
Sergio Pedri committed 2021-11-15 19:39:33 +01:00
1 親 e17f622032
コミット 87343a3137
18ファイル変更
+71 -71

検索条件に一致するファイルはありません

+1 -1
ファイルの表示
@@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.Toolkit.Diagnostics" Version="7.1.1" />
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="2.0.0-beta3.1459250354" />
<PackageReference Include="TerraFX.Interop.D3D12MemoryAllocator" Version="2.0.0-beta3.1463073211" />
</ItemGroup>
<Choose>
+2 -2
ファイルの表示
@@ -176,7 +176,7 @@ internal static unsafe class ID3D12DeviceExtensions
{
D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default;
d3D12ShaderResourceViewDescription.ViewDimension = D3D12_SRV_DIMENSION_BUFFER;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = DirectX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = D3D12.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Buffer.NumElements = bufferSize;
d3D12ShaderResourceViewDescription.Buffer.StructureByteStride = elementSize;
@@ -201,7 +201,7 @@ internal static unsafe class ID3D12DeviceExtensions
D3D12_SHADER_RESOURCE_VIEW_DESC d3D12ShaderResourceViewDescription = default;
d3D12ShaderResourceViewDescription.ViewDimension = d3D12SrvDimension;
d3D12ShaderResourceViewDescription.Format = dxgiFormat;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = DirectX.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Shader4ComponentMapping = D3D12.D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
d3D12ShaderResourceViewDescription.Texture2D.MipLevels = uint.MaxValue;
d3D12Device.CreateShaderResourceView(d3D12Resource, &d3D12ShaderResourceViewDescription, d3D12CpuDescriptorHandle);
+1 -1
ファイルの表示
@@ -51,7 +51,7 @@ internal static class D3D12FeatureHelper
&d3D12Options7,
(uint)sizeof(D3D12_FEATURE_DATA_D3D12_OPTIONS7));
if (result == Windows.S_OK)
if (result == S.S_OK)
{
return D3D12_HEAP_FLAGS.D3D12_HEAP_FLAG_CREATE_NOT_ZEROED;
}
+1 -1
ファイルの表示
@@ -123,7 +123,7 @@ internal static partial class DeviceHelper
Windows.__uuidof<IDXGIAdapter1>(),
dxgiAdapter1.GetVoidAddressOf());
if (enumAdapters1Result == Windows.DXGI_ERROR_NOT_FOUND)
if (enumAdapters1Result == DXGI.DXGI_ERROR_NOT_FOUND)
{
this.dxgiFactory6.Get()->EnumWarpAdapter(Windows.__uuidof<IDXGIAdapter1>(), dxgiAdapter1.GetVoidAddressOf()).Assert();
+2 -2
ファイルの表示
@@ -18,7 +18,7 @@ internal static partial class DeviceHelper
/// </summary>
private const uint IDXGIFactoryCreationFlags =
#if DEBUG
DirectX.DXGI_CREATE_FACTORY_DEBUG;
DXGI.DXGI_CREATE_FACTORY_DEBUG;
#else
0;
#endif
@@ -37,7 +37,7 @@ internal static partial class DeviceHelper
HRESULT result = dxgiFactory4.CopyTo(dxgiFactory6);
if (result == Windows.S_OK)
if (result == S.S_OK)
{
return;
}
+1 -1
ファイルの表示
@@ -99,7 +99,7 @@ internal static partial class DeviceHelper
Windows.__uuidof<IDXGIAdapter1>(),
dxgiAdapter1.GetVoidAddressOf());
if (enumAdapters1Result == Windows.DXGI_ERROR_NOT_FOUND)
if (enumAdapters1Result == DXGI.DXGI_ERROR_NOT_FOUND)
{
return false;
}
+33 -33
ファイルの表示
@@ -23,11 +23,11 @@ internal static class WICFormatHelper
public static Guid GetForType<T>()
where T : unmanaged
{
if (typeof(T) == typeof(Bgra32)) return Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba32)) return Windows.GUID_WICPixelFormat32bppRGBA;
else if (typeof(T) == typeof(Rgba64)) return Windows.GUID_WICPixelFormat64bppRGBA;
else if (typeof(T) == typeof(R8)) return Windows.GUID_WICPixelFormat8bppGray;
else if (typeof(T) == typeof(R16)) return Windows.GUID_WICPixelFormat16bppGray;
if (typeof(T) == typeof(Bgra32)) return GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba32)) return GUID.GUID_WICPixelFormat32bppRGBA;
else if (typeof(T) == typeof(Rgba64)) return GUID.GUID_WICPixelFormat64bppRGBA;
else if (typeof(T) == typeof(R8)) return GUID.GUID_WICPixelFormat8bppGray;
else if (typeof(T) == typeof(R16)) return GUID.GUID_WICPixelFormat16bppGray;
else return ThrowHelper.ThrowArgumentException<Guid>("Invalid texture type");
}
@@ -42,58 +42,58 @@ internal static class WICFormatHelper
public static bool TryGetIntermediateFormatForType<T>(Guid containerFormat, out Guid intermediateFormat)
where T : unmanaged
{
if (containerFormat == Windows.GUID_ContainerFormatBmp)
if (containerFormat == GUID.GUID_ContainerFormatBmp)
{
if (typeof(T) == typeof(Bgra32)) intermediateFormat = default;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(R8)) intermediateFormat = Windows.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(R16)) intermediateFormat = Windows.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(R8)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR;
else intermediateFormat = ThrowHelper.ThrowArgumentException<Guid>("Invalid texture type");
}
else if (containerFormat == Windows.GUID_ContainerFormatPng)
else if (containerFormat == GUID.GUID_ContainerFormatPng)
{
if (typeof(T) == typeof(Bgra32)) intermediateFormat = default;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default;
else if (typeof(T) == typeof(R8)) intermediateFormat = default;
else if (typeof(T) == typeof(R16)) intermediateFormat = Windows.GUID_WICPixelFormat8bppGray;
else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat8bppGray;
else intermediateFormat = ThrowHelper.ThrowArgumentException<Guid>("Invalid texture type");
}
else if (containerFormat == Windows.GUID_ContainerFormatJpeg)
else if (containerFormat == GUID.GUID_ContainerFormatJpeg)
{
if (typeof(T) == typeof(Bgra32)) intermediateFormat = Windows.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = Windows.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = Windows.GUID_WICPixelFormat24bppBGR;
if (typeof(T) == typeof(Bgra32)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = GUID.GUID_WICPixelFormat24bppBGR;
else if (typeof(T) == typeof(R8)) intermediateFormat = default;
else if (typeof(T) == typeof(R16)) intermediateFormat = Windows.GUID_WICPixelFormat8bppGray;
else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat8bppGray;
else intermediateFormat = ThrowHelper.ThrowArgumentException<Guid>("Invalid texture type");
}
else if (containerFormat == Windows.GUID_ContainerFormatWmp)
else if (containerFormat == GUID.GUID_ContainerFormatWmp)
{
if (typeof(T) == typeof(Bgra32)) intermediateFormat = default;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default;
else if (typeof(T) == typeof(R8)) intermediateFormat = default;
else if (typeof(T) == typeof(R16)) intermediateFormat = default;
else intermediateFormat = ThrowHelper.ThrowArgumentException<Guid>("Invalid texture type");
}
else if (containerFormat == Windows.GUID_ContainerFormatTiff)
else if (containerFormat == GUID.GUID_ContainerFormatTiff)
{
if (typeof(T) == typeof(Bgra32)) intermediateFormat = default;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = default;
else if (typeof(T) == typeof(R8)) intermediateFormat = default;
else if (typeof(T) == typeof(R16)) intermediateFormat = default;
else intermediateFormat = ThrowHelper.ThrowArgumentException<Guid>("Invalid texture type");
}
else if (containerFormat == Windows.GUID_ContainerFormatDds)
else if (containerFormat == GUID.GUID_ContainerFormatDds)
{
if (typeof(T) == typeof(Bgra32)) intermediateFormat = default;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(R8)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(R16)) intermediateFormat = Windows.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba32)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(Rgba64)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(R8)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else if (typeof(T) == typeof(R16)) intermediateFormat = GUID.GUID_WICPixelFormat32bppBGRA;
else intermediateFormat = ThrowHelper.ThrowArgumentException<Guid>("Invalid texture type");
}
else
@@ -115,16 +115,16 @@ internal static class WICFormatHelper
{
return Path.GetExtension(filename).ToString() switch
{
".bmp" => Windows.GUID_ContainerFormatBmp,
".png" => Windows.GUID_ContainerFormatPng,
".bmp" => GUID.GUID_ContainerFormatBmp,
".png" => GUID.GUID_ContainerFormatPng,
".jpg" or
".jpeg" => Windows.GUID_ContainerFormatJpeg,
".jpeg" => GUID.GUID_ContainerFormatJpeg,
".jxr" or
".hdp" or
".wdp" or
".wmp" => Windows.GUID_ContainerFormatWmp,
".tiff" => Windows.GUID_ContainerFormatTiff,
".dds" => Windows.GUID_ContainerFormatDds,
".wmp" => GUID.GUID_ContainerFormatWmp,
".tiff" => GUID.GUID_ContainerFormatTiff,
".dds" => GUID.GUID_ContainerFormatDds,
_ => ThrowHelper.ThrowArgumentException<Guid>("Invalid filename"),
};
}
+2 -2
ファイルの表示
@@ -60,7 +60,7 @@ public unsafe abstract class Buffer<T> : NativeObject
if (resourceType == ResourceType.Constant)
{
Guard.IsBetweenOrEqualTo(length, 1, DirectX.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length));
Guard.IsBetweenOrEqualTo(length, 1, D3D12.D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT, nameof(length));
}
else
{
@@ -75,7 +75,7 @@ public unsafe abstract class Buffer<T> : NativeObject
}
nint usableSizeInBytes = checked((nint)(length * elementSizeInBytes));
nint effectiveSizeInBytes = resourceType == ResourceType.Constant ? AlignmentHelper.Pad(usableSizeInBytes, DirectX.D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT) : usableSizeInBytes;
nint effectiveSizeInBytes = resourceType == ResourceType.Constant ? AlignmentHelper.Pad(usableSizeInBytes, D3D12.D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT) : usableSizeInBytes;
SizeInBytes = usableSizeInBytes;
GraphicsDevice = device;
+2 -2
ファイルの表示
@@ -74,8 +74,8 @@ public unsafe abstract class Texture2D<T> : NativeObject, GraphicsResourceHelper
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
{
+3 -3
ファイルの表示
@@ -75,9 +75,9 @@ public unsafe abstract class Texture3D<T> : NativeObject, GraphicsResourceHelper
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), d3D12FormatSupport))
{
+2 -2
ファイルの表示
@@ -50,8 +50,8 @@ public unsafe abstract class TransferTexture2D<T> : NativeObject
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION, nameof(height));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE2D))
{
+3 -3
ファイルの表示
@@ -51,9 +51,9 @@ public unsafe abstract class TransferTexture3D<T> : NativeObject
{
device.ThrowIfDisposed();
Guard.IsBetweenOrEqualTo(width, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, DirectX.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
Guard.IsBetweenOrEqualTo(width, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(width));
Guard.IsBetweenOrEqualTo(height, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(height));
Guard.IsBetweenOrEqualTo(depth, 1, D3D12.D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION, nameof(depth));
if (!device.D3D12Device->IsDxgiFormatSupported(DXGIFormatHelper.GetForType<T>(), D3D12_FORMAT_SUPPORT1_TEXTURE3D))
{
+1 -1
ファイルの表示
@@ -26,7 +26,7 @@ public sealed class ConstantBuffer<T> : Buffer<T>
/// <summary>
/// The alignment boundary for elements in a constant buffer.
/// </summary>
private const int ElementAlignment = DirectX.D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT;
private const int ElementAlignment = D3D12.D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT;
/// <summary>
/// Creates a new <see cref="ConstantBuffer{T}"/> instance with the specified parameters.
+1 -1
ファイルの表示
@@ -45,6 +45,6 @@ public struct ResourceDescriptor
descriptor.BaseShaderRegister = offset;
descriptor.RegisterSpace = 0;
descriptor.Flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE;
descriptor.OffsetInDescriptorsFromTableStart = DirectX.D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
descriptor.OffsetInDescriptorsFromTableStart = D3D12.D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
}
}
+5 -5
ファイルの表示
@@ -119,9 +119,9 @@ internal static class ShaderRunner<T>
int groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1);
int groupsZ = Math.DivRem(z, threadsZ, out int modZ) + (modZ == 0 ? 0 : 1);
Guard.IsBetweenOrEqualTo(groupsX, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsZ, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsX, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsZ, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, threadsZ);
PipelineData? pipelineData;
@@ -174,8 +174,8 @@ internal static class ShaderRunner<T>
int groupsX = Math.DivRem(x, threadsX, out int modX) + (modX == 0 ? 0 : 1);
int groupsY = Math.DivRem(y, threadsY, out int modY) + (modY == 0 ? 0 : 1);
Guard.IsBetweenOrEqualTo(groupsX, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, DirectX.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsX, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
Guard.IsBetweenOrEqualTo(groupsY, 1, D3D11.D3D11_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, nameof(groupsX));
ShaderKey key = new(shader.GetDispatchId(), threadsX, threadsY, 1);
PipelineData? pipelineData;