mirror of
https://github.com/amerkoleci/Vortice.Win32.git
synced 2026-01-14 16:16:04 +08:00
More goodies and improvements.
This commit is contained in:
@@ -857,6 +857,7 @@ public static class Program
|
||||
{ "DXGI_DEBUG_RLO_FLAGS", "ReportLiveObjectFlags" },
|
||||
|
||||
// D3D11
|
||||
{ "D3D11_MAP", "MapMode" },
|
||||
{ "D3D11_RLDO_FLAGS", "ReportLiveDeviceObjectFlags" },
|
||||
{ "D3D11_1_CREATE_DEVICE_CONTEXT_STATE_FLAG", "CreateDeviceContextStateFlags" },
|
||||
{ "D3D11_QUERY", "QueryType" },
|
||||
@@ -961,6 +962,12 @@ public static class Program
|
||||
{ "IDXGISwapChain3::Present::Flags", "DXGI_PRESENT" },
|
||||
{ "IDXGISwapChain4::Present::Flags", "DXGI_PRESENT" },
|
||||
|
||||
{ "IDXGISwapChain::ResizeBuffers::SwapChainFlags", "DXGI_SWAP_CHAIN_FLAG" },
|
||||
{ "IDXGISwapChain1::ResizeBuffers::SwapChainFlags", "DXGI_SWAP_CHAIN_FLAG" },
|
||||
{ "IDXGISwapChain2::ResizeBuffers::SwapChainFlags", "DXGI_SWAP_CHAIN_FLAG" },
|
||||
{ "IDXGISwapChain3::ResizeBuffers::SwapChainFlags", "DXGI_SWAP_CHAIN_FLAG" },
|
||||
{ "IDXGISwapChain4::ResizeBuffers::SwapChainFlags", "DXGI_SWAP_CHAIN_FLAG" },
|
||||
|
||||
// D3D11
|
||||
{ "ID3D11DeviceContext::Map::MapFlags", "D3D11_MAP_FLAG" },
|
||||
{ "ID3D11DeviceContext::ClearDepthStencilView::ClearFlags", "D3D11_CLEAR_FLAG" },
|
||||
|
||||
@@ -2684,7 +2684,7 @@ public enum ResourceMiscFlags : uint
|
||||
|
||||
/// <include file='../Direct3D11.xml' path='doc/member[@name="D3D11_MAP"]/*' />
|
||||
/// <unmanaged>D3D11_MAP</unmanaged>
|
||||
public enum Map : int
|
||||
public enum MapMode : int
|
||||
{
|
||||
/// <include file='../Direct3D11.xml' path='doc/member[@name="D3D11_MAP::D3D11_MAP_READ"]/*' />
|
||||
/// <unmanaged>D3D11_MAP_READ</unmanaged>
|
||||
|
||||
@@ -161,9 +161,9 @@ public unsafe partial struct ID3D11DeviceContext
|
||||
/// <include file='../../Direct3D11.xml' path='doc/member[@name="ID3D11DeviceContext::Map"]/*' />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(14)]
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, Map MapType, MapFlags MapFlags, MappedSubresource* pMappedResource)
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, MapMode MapType, MapFlags MapFlags, MappedSubresource* pMappedResource)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext*, ID3D11Resource*, uint, Map, MapFlags, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext*, ID3D11Resource*, uint, MapMode, MapFlags, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
}
|
||||
|
||||
/// <include file='../../Direct3D11.xml' path='doc/member[@name="ID3D11DeviceContext::Unmap"]/*' />
|
||||
|
||||
@@ -161,9 +161,9 @@ public unsafe partial struct ID3D11DeviceContext1
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Map" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(14)]
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, Map MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, MapMode MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext1*, ID3D11Resource*, uint, Map, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext1*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext1*, ID3D11Resource*, uint, MapMode, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext1*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Unmap" />
|
||||
|
||||
@@ -161,9 +161,9 @@ public unsafe partial struct ID3D11DeviceContext2
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Map" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(14)]
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, Map MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, MapMode MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext2*, ID3D11Resource*, uint, Map, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext2*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext2*, ID3D11Resource*, uint, MapMode, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext2*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Unmap" />
|
||||
|
||||
@@ -161,9 +161,9 @@ public unsafe partial struct ID3D11DeviceContext3
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Map" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(14)]
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, Map MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, MapMode MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext3*, ID3D11Resource*, uint, Map, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext3*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext3*, ID3D11Resource*, uint, MapMode, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext3*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Unmap" />
|
||||
|
||||
@@ -161,9 +161,9 @@ public unsafe partial struct ID3D11DeviceContext4
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Map" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(14)]
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, Map MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
public HResult Map(ID3D11Resource* pResource, uint Subresource, MapMode MapType, uint MapFlags, MappedSubresource* pMappedResource)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext4*, ID3D11Resource*, uint, Map, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext4*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D11DeviceContext4*, ID3D11Resource*, uint, MapMode, uint, MappedSubresource*, int>)(lpVtbl[14]))((ID3D11DeviceContext4*)Unsafe.AsPointer(ref this), pResource, Subresource, MapType, MapFlags, pMappedResource);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="ID3D11DeviceContext.Unmap" />
|
||||
|
||||
@@ -153,9 +153,9 @@ public unsafe partial struct IDXGISwapChain
|
||||
/// <include file='../../Dxgi.xml' path='doc/member[@name="IDXGISwapChain::ResizeBuffers"]/*' />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(13)]
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, uint SwapChainFlags)
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, SwapChainFlags SwapChainFlags)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain*, uint, uint, uint, Common.Format, uint, int>)(lpVtbl[13]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain*, uint, uint, uint, Common.Format, SwapChainFlags, int>)(lpVtbl[13]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
}
|
||||
|
||||
/// <include file='../../Dxgi.xml' path='doc/member[@name="IDXGISwapChain::ResizeTarget"]/*' />
|
||||
|
||||
@@ -153,9 +153,9 @@ public unsafe partial struct IDXGISwapChain1
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeBuffers" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(13)]
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, uint SwapChainFlags)
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, SwapChainFlags SwapChainFlags)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain1*, uint, uint, uint, Common.Format, uint, int>)(lpVtbl[13]))((IDXGISwapChain1*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain1*, uint, uint, uint, Common.Format, SwapChainFlags, int>)(lpVtbl[13]))((IDXGISwapChain1*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeTarget" />
|
||||
|
||||
@@ -153,9 +153,9 @@ public unsafe partial struct IDXGISwapChain2
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeBuffers" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(13)]
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, uint SwapChainFlags)
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, SwapChainFlags SwapChainFlags)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain2*, uint, uint, uint, Common.Format, uint, int>)(lpVtbl[13]))((IDXGISwapChain2*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain2*, uint, uint, uint, Common.Format, SwapChainFlags, int>)(lpVtbl[13]))((IDXGISwapChain2*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeTarget" />
|
||||
|
||||
@@ -153,9 +153,9 @@ public unsafe partial struct IDXGISwapChain3
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeBuffers" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(13)]
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, uint SwapChainFlags)
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, SwapChainFlags SwapChainFlags)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain3*, uint, uint, uint, Common.Format, uint, int>)(lpVtbl[13]))((IDXGISwapChain3*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain3*, uint, uint, uint, Common.Format, SwapChainFlags, int>)(lpVtbl[13]))((IDXGISwapChain3*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeTarget" />
|
||||
|
||||
@@ -153,9 +153,9 @@ public unsafe partial struct IDXGISwapChain4
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeBuffers" />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
[VtblIndex(13)]
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, uint SwapChainFlags)
|
||||
public HResult ResizeBuffers(uint BufferCount, uint Width, uint Height, Common.Format NewFormat, SwapChainFlags SwapChainFlags)
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain4*, uint, uint, uint, Common.Format, uint, int>)(lpVtbl[13]))((IDXGISwapChain4*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
return ((delegate* unmanaged[Stdcall]<IDXGISwapChain4*, uint, uint, uint, Common.Format, SwapChainFlags, int>)(lpVtbl[13]))((IDXGISwapChain4*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDXGISwapChain.ResizeTarget" />
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
namespace Win32.Graphics;
|
||||
|
||||
public static partial class Apis
|
||||
{
|
||||
}
|
||||
|
||||
#region Enums
|
||||
/// <include file='../.xml' path='doc/member[@name="D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE"]/*' />
|
||||
/// <unmanaged>D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE</unmanaged>
|
||||
public enum AffineTransform2DInterpolationMode : uint
|
||||
{
|
||||
/// <include file='../.xml' path='doc/member[@name="D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE::D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_NEAREST_NEIGHBOR"]/*' />
|
||||
/// <unmanaged>D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_NEAREST_NEIGHBOR</unmanaged>
|
||||
NearestNeighbor = 0,
|
||||
/// <include file='../.xml' path='doc/member[@name="D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE::D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_LINEAR"]/*' />
|
||||
/// <unmanaged>D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_LINEAR</unmanaged>
|
||||
Linear = 1,
|
||||
/// <include file='../.xml' path='doc/member[@name="D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE::D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_CUBIC"]/*' />
|
||||
/// <unmanaged>D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_CUBIC</unmanaged>
|
||||
Cubic = 2,
|
||||
/// <include file='../.xml' path='doc/member[@name="D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE::D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR"]/*' />
|
||||
/// <unmanaged>D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR</unmanaged>
|
||||
MultiSampleLinear = 3,
|
||||
/// <include file='../.xml' path='doc/member[@name="D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE::D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC"]/*' />
|
||||
/// <unmanaged>D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_ANISOTROPIC</unmanaged>
|
||||
Anisotropic = 4,
|
||||
/// <include file='../.xml' path='doc/member[@name="D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE::D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC"]/*' />
|
||||
/// <unmanaged>D2D1_2DAFFINETRANSFORM_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC</unmanaged>
|
||||
HighQualityCubic = 5,
|
||||
}
|
||||
#endregion Enums
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Win32.Graphics.Direct3D11;
|
||||
|
||||
public unsafe partial struct ID3D11Device
|
||||
{
|
||||
public ComPtr<ID3D11Buffer> CreateBuffe(BufferDescription* description, SubresourceData* initialData = default)
|
||||
public ComPtr<ID3D11Buffer> CreateBuffer(BufferDescription* description, SubresourceData* initialData = default)
|
||||
{
|
||||
using ComPtr<ID3D11Buffer> buffer = default;
|
||||
CreateBuffer(description, initialData, buffer.GetAddressOf()).ThrowIfFailed();
|
||||
@@ -245,4 +245,11 @@ public unsafe partial struct ID3D11Device
|
||||
|
||||
return texture.Move();
|
||||
}
|
||||
|
||||
public ComPtr<ID3D11DeviceContext> CreateDeferredContext()
|
||||
{
|
||||
using ComPtr<ID3D11DeviceContext> deferredContext = default;
|
||||
CreateDeferredContext(0u, deferredContext.GetAddressOf()).ThrowIfFailed();
|
||||
return deferredContext.Move();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,11 @@ public unsafe partial struct ID3D11DeviceContext
|
||||
OMSetBlendState(blendState, null, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
||||
public void IASetVertexBuffer(int slot, ID3D11Buffer* buffer, uint stride, uint offset = 0)
|
||||
{
|
||||
IASetVertexBuffers((uint)slot, 1, buffer == null ? null : &buffer, &stride, &offset);
|
||||
}
|
||||
|
||||
public void VSSetShader(ID3D11VertexShader* shader)
|
||||
{
|
||||
VSSetShader(shader, null, 0);
|
||||
@@ -99,6 +104,67 @@ public unsafe partial struct ID3D11DeviceContext
|
||||
CSSetConstantBuffers(slot, 1, constantBuffer != null ? &constantBuffer : null);
|
||||
}
|
||||
|
||||
public void UnsetRenderTargets()
|
||||
{
|
||||
OMSetRenderTargets(0, null, null);
|
||||
}
|
||||
|
||||
public void OMSetRenderTargets(ID3D11RenderTargetView* renderTargetView, ID3D11DepthStencilView* depthStencilView = null)
|
||||
{
|
||||
OMSetRenderTargets(1,
|
||||
renderTargetView == null ? null : &renderTargetView,
|
||||
depthStencilView);
|
||||
}
|
||||
|
||||
public void ClearRenderTargetView(ID3D11RenderTargetView* renderTargetView, Color4 color)
|
||||
{
|
||||
ClearRenderTargetView(renderTargetView, (float*)&color);
|
||||
}
|
||||
|
||||
public void ClearUnorderedAccessViewFloat(ID3D11UnorderedAccessView* unorderedAccessView, Color4 color)
|
||||
{
|
||||
ClearUnorderedAccessViewFloat(unorderedAccessView, (float*)&color);
|
||||
}
|
||||
|
||||
public HResult Map(ID3D11Texture2D* resource,
|
||||
uint mipSlice, uint arraySlice,
|
||||
MapMode mode, MapFlags flags,
|
||||
MappedSubresource* pMappedResource, out uint subresource, out uint mipSize)
|
||||
{
|
||||
subresource = resource->CalculateSubResourceIndex(mipSlice, arraySlice, out mipSize);
|
||||
return Map((ID3D11Resource*)resource, subresource, mode, flags, pMappedResource);
|
||||
}
|
||||
|
||||
public Span<T> Map<T>(ID3D11Texture2D* resource,
|
||||
uint mipSlice, uint arraySlice,
|
||||
MapMode mode = MapMode.Read, MapFlags flags = MapFlags.None) where T : unmanaged
|
||||
{
|
||||
uint subresource = resource->CalculateSubResourceIndex(mipSlice, arraySlice, out uint mipSize);
|
||||
MappedSubresource mappedSubresource;
|
||||
Map((ID3D11Resource*)resource, subresource, mode, flags, &mappedSubresource).ThrowIfFailed();
|
||||
|
||||
Span<byte> source = new(mappedSubresource.pData, (int)(mipSize * mappedSubresource.RowPitch));
|
||||
return global::System.Runtime.InteropServices.MemoryMarshal.Cast<byte, T>(source);
|
||||
}
|
||||
|
||||
public void Unmap(ID3D11Texture1D* resource, uint mipSlice, uint arraySlice)
|
||||
{
|
||||
uint subresource = resource->CalculateSubResourceIndex(mipSlice, arraySlice, out _);
|
||||
Unmap((ID3D11Resource*)resource, subresource);
|
||||
}
|
||||
|
||||
public void Unmap(ID3D11Texture2D* resource, uint mipSlice, uint arraySlice)
|
||||
{
|
||||
uint subresource = resource->CalculateSubResourceIndex(mipSlice, arraySlice, out _);
|
||||
Unmap((ID3D11Resource*)resource, subresource);
|
||||
}
|
||||
|
||||
public void Unmap(ID3D11Texture3D* resource, uint mipSlice, uint arraySlice)
|
||||
{
|
||||
uint subresource = resource->CalculateSubResourceIndex(mipSlice, arraySlice, out _);
|
||||
Unmap((ID3D11Resource*)resource, subresource);
|
||||
}
|
||||
|
||||
public ComPtr<ID3D11CommandList> FinishCommandList(bool RestoreDeferredContextState = false)
|
||||
{
|
||||
using ComPtr<ID3D11CommandList> commandList = default;
|
||||
|
||||
@@ -38,9 +38,10 @@ public unsafe partial struct StaticSamplerDescription
|
||||
/// Initializes a new instance of the <see cref="StaticSamplerDescription"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="samplerDescription">Sampler description</param>
|
||||
/// <param name="shaderVisibility">The shader visibility.</param>
|
||||
/// <param name="shaderRegister">The shader register.</param>
|
||||
/// <param name="registerSpace">The register space.</param>
|
||||
/// <param name="shaderVisibility">The shader visibility</param>
|
||||
/// <param name="shaderRegister">The shader register</param>
|
||||
/// <param name="registerSpace">The register space</param>
|
||||
/// <param name="borderColor">The <see cref="StaticBorderColor"/> value</param>
|
||||
public StaticSamplerDescription(
|
||||
in SamplerDescription samplerDescription,
|
||||
ShaderVisibility shaderVisibility,
|
||||
|
||||
63
src/Vortice.Win32/Graphics/Dxgi/SwapChainDescription1.cs
Normal file
63
src/Vortice.Win32/Graphics/Dxgi/SwapChainDescription1.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
using Win32.Graphics.Dxgi.Common;
|
||||
|
||||
namespace Win32.Graphics.Dxgi;
|
||||
|
||||
public partial struct SwapChainDescription1
|
||||
{
|
||||
/// <summary>
|
||||
/// Create new instance of <see cref="SwapChainDescription1"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="height"></param>
|
||||
/// <param name="format">A <see cref="Common.Format"/> that describes the display format.</param>
|
||||
/// <param name="stereo">
|
||||
/// Specifies whether the full-screen display mode or the swap-chain back buffer is stereo. TRUE if stereo; otherwise, FALSE.
|
||||
/// If you specify stereo, you must also specify a flip-model swap chain (that is, a swap chain that has the <see cref="SwapEffect.FlipSequential"/> value set in the SwapEffect member).
|
||||
/// </param>
|
||||
/// <param name="bufferUsage">
|
||||
/// A <see cref="Usage"/> value that describes the surface usage and CPU access options for the back buffer. The back buffer can be used for shader input or render-target output.
|
||||
/// </param>
|
||||
/// <param name="bufferCount">
|
||||
/// A value that describes the number of buffers in the swap chain. When you create a full-screen swap chain, you typically include the front buffer in this value.
|
||||
/// </param>
|
||||
/// <param name="scaling">
|
||||
/// A <see cref="Scaling"/> value that identifies resize behavior if the size of the back buffer is not equal to the target output.
|
||||
/// </param>
|
||||
/// <param name="swapEffect">
|
||||
/// A <see cref="Dxgi.SwapEffect"/> value that describes the presentation model that is used by the swap chain and options for handling the contents of the presentation buffer after presenting a surface.
|
||||
/// You must specify the <see cref="SwapEffect.FlipSequential"/> value when you call the <see cref="IDXGIFactory2.CreateSwapChainForComposition(SharpGen.Runtime.IUnknown, SwapChainDescription1, IDXGIOutput?)"/> method because this method supports only flip presentation model.
|
||||
/// </param>
|
||||
/// <param name="alphaMode">
|
||||
/// A <see cref="Dxgi.Common.AlphaMode"/> value that identifies the transparency behavior of the swap-chain back buffer.
|
||||
/// </param>
|
||||
/// <param name="flags">
|
||||
/// A combination of <see cref="SwapChainFlags"/> values that are combined by using a bitwise OR operation. The resulting value specifies options for swap-chain behavior.
|
||||
/// </param>
|
||||
public SwapChainDescription1(
|
||||
uint width,
|
||||
uint height,
|
||||
Format format = Format.B8G8R8A8Unorm,
|
||||
bool stereo = false,
|
||||
Usage bufferUsage = Usage.RenderTargetOutput,
|
||||
uint bufferCount = 2,
|
||||
Scaling scaling = Scaling.Stretch,
|
||||
SwapEffect swapEffect = SwapEffect.FlipDiscard,
|
||||
AlphaMode alphaMode = AlphaMode.Ignore,
|
||||
SwapChainFlags flags = SwapChainFlags.None)
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
Format = format;
|
||||
Stereo = stereo;
|
||||
SampleDesc = SampleDescription.Default;
|
||||
BufferUsage = bufferUsage;
|
||||
BufferCount = bufferCount;
|
||||
Scaling = scaling;
|
||||
SwapEffect = swapEffect;
|
||||
AlphaMode = alphaMode;
|
||||
Flags = flags;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
|
||||
<Description>Windows API low level bindings.</Description>
|
||||
<VersionPrefix>1.6.5</VersionPrefix>
|
||||
<VersionPrefix>1.6.6</VersionPrefix>
|
||||
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<EnablePreviewFeatures>True</EnablePreviewFeatures>
|
||||
|
||||
Reference in New Issue
Block a user