Skip to content

Commit

Permalink
Big DirectX checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hall committed Dec 23, 2024
1 parent b2a213a commit 49cde0b
Show file tree
Hide file tree
Showing 35 changed files with 26,417 additions and 2,184 deletions.
1 change: 1 addition & 0 deletions Core/InteropServices/Matrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public bool IsIdentity
return true;
}
}

/// <summary>Gets a value indicating whether this instance is singluar.</summary>
/// <value><c>true</c> if this instance is singluar; otherwise, <c>false</c>.</value>
public bool IsSingluar => Determinant.Equals(0f);
Expand Down
14 changes: 7 additions & 7 deletions PInvoke/D3DCompiler/D3D11Shader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ HRESULT PassValueWithSwizzle([In] ID3D11LinkingNode pSrcNode, int SrcParameterIn
// https://learn.microsoft.com/en-us/windows/win32/api/d3d11shader/nf-d3d11shader-id3d11functionlinkinggraph-getlasterror HRESULT
// GetLastError( [out, optional] ID3DBlob **ppErrorBuffer );
[PreserveSig]
HRESULT GetLastError(out ID3D10Blob ppErrorBuffer);
HRESULT GetLastError(out ID3DBlob ppErrorBuffer);

/// <summary>Generates Microsoft High Level Shader Language (HLSL) shader code that represents the function-linking-graph.</summary>
/// <param name="uFlags">
Expand All @@ -328,7 +328,7 @@ HRESULT PassValueWithSwizzle([In] ID3D11LinkingNode pSrcNode, int SrcParameterIn
// https://learn.microsoft.com/en-us/windows/win32/api/d3d11shader/nf-d3d11shader-id3d11functionlinkinggraph-generatehlsl HRESULT
// GenerateHlsl( [in] UINT uFlags, [out] ID3DBlob **ppBuffer );
[PreserveSig]
HRESULT GenerateHlsl([Optional] uint uFlags, out ID3D10Blob ppBuffer);
HRESULT GenerateHlsl([Optional] uint uFlags, out ID3DBlob ppBuffer);
}

/// <summary>
Expand Down Expand Up @@ -603,7 +603,7 @@ public interface ID3D11Linker
// [out, optional] ID3DBlob **ppErrorBuffer );
[PreserveSig]
HRESULT Link([In] ID3D11ModuleInstance pEntry, [MarshalAs(UnmanagedType.LPStr)] string pEntryName, [MarshalAs(UnmanagedType.LPStr)] string pTargetName,
[Optional] uint uFlags, out ID3D10Blob ppShaderBlob, [Out, Optional] IntPtr ppErrorBuffer);
[Optional] uint uFlags, out ID3DBlob ppShaderBlob, [Out, Optional] IntPtr ppErrorBuffer);

/// <summary>Adds an instance of a library module to be used for linking.</summary>
/// <param name="pLibraryMI">
Expand Down Expand Up @@ -1813,13 +1813,13 @@ public interface ID3D11ShaderReflectionVariable
/// </returns>
// https://learn.microsoft.com/en-us/windows/win32/api/d3d11shader/nf-d3d11shader-id3d11functionlinkinggraph-createmoduleinstance
// HRESULT CreateModuleInstance( [out] ID3D11ModuleInstance **ppModuleInstance, [out, optional] ID3DBlob **ppErrorBuffer );
public static HRESULT CreateModuleInstance(this ID3D11FunctionLinkingGraph graph, out ID3D11ModuleInstance ppModuleInstance, out ID3D10Blob? ppErrorBuffer)
public static HRESULT CreateModuleInstance(this ID3D11FunctionLinkingGraph graph, out ID3D11ModuleInstance ppModuleInstance, out ID3DBlob? ppErrorBuffer)
{
unsafe
{
IntPtr pBlob = IntPtr.Zero;
var hr = graph.CreateModuleInstance(out ppModuleInstance, new IntPtr(&pBlob));
ppErrorBuffer = hr.Failed ? null : (ID3D10Blob)Marshal.GetObjectForIUnknown(pBlob);
ppErrorBuffer = hr.Failed ? null : (ID3DBlob)Marshal.GetObjectForIUnknown(pBlob);
return hr;
}
}
Expand Down Expand Up @@ -1851,13 +1851,13 @@ public static HRESULT CreateModuleInstance(this ID3D11FunctionLinkingGraph graph
/// <para>Returns S_OK if successful; otherwise, returns one of the Direct3D 11 Return Codes.</para>
/// </returns>
public static HRESULT Link(this ID3D11Linker linker, [In] ID3D11ModuleInstance pEntry, string pEntryName, string pTargetName,
out ID3D10Blob ppShaderBlob, out ID3D10Blob? ppErrorBuffer)
out ID3DBlob ppShaderBlob, out ID3DBlob? ppErrorBuffer)
{
unsafe
{
IntPtr pErr = IntPtr.Zero;
var hr = linker.Link(pEntry, pEntryName, pTargetName, 0, out ppShaderBlob, new IntPtr(&pErr));
ppErrorBuffer = hr.Failed ? null : (ID3D10Blob)Marshal.GetObjectForIUnknown(pErr);
ppErrorBuffer = hr.Failed ? null : (ID3DBlob)Marshal.GetObjectForIUnknown(pErr);
return hr;
}
}
Expand Down
2 changes: 1 addition & 1 deletion PInvoke/D3DCompiler/D3DCompiler.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global using static Vanara.PInvoke.DXGI;
global using ID3DBlob = Vanara.PInvoke.DXGI.ID3D10Blob;
global using ID3DBlob = Vanara.PInvoke.DXGI.ID3DBlob;

namespace Vanara.PInvoke;

Expand Down
2 changes: 1 addition & 1 deletion PInvoke/D3DCompiler/DxcApi.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using static Vanara.PInvoke.Ole32;
using IDxcBlob = Vanara.PInvoke.DXGI.ID3D10Blob;
using IDxcBlob = Vanara.PInvoke.DXGI.ID3DBlob;

namespace Vanara.PInvoke;

Expand Down
410 changes: 297 additions & 113 deletions PInvoke/DWrite/Dwrite.Interfaces.cs

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions PInvoke/DWrite/Dwrite_1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3279,17 +3279,21 @@ public interface IDWriteFont1 : IDWriteFont

/// <summary>Determines whether the font supports a specified character.</summary>
/// <param name="unicodeValue">
/// <para>Type: <c>UINT32</c></para>
/// <para>Type: <b>UINT32</b></para>
/// <para>A Unicode (UCS-4) character value for the method to inspect.</para>
/// </param>
/// <param name="exists">
/// <para>Type: <b>BOOL*</b></para>
/// <para>When this method returns, <b>TRUE</b> if the font supports the specified character; otherwise, <b>FALSE</b>.</para>
/// </param>
/// <returns>
/// <para>Type: <c>BOOL*</c></para>
/// <para>When this method returns, <c>TRUE</c> if the font supports the specified character; otherwise, <c>FALSE</c>.</para>
/// <para>Type: <b>HRESULT</b></para>
/// <para>If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritefont-hascharacter HRESULT HasCharacter( UINT32
// unicodeValue, BOOL *exists );
[return: MarshalAs(UnmanagedType.Bool)]
new bool HasCharacter(uint unicodeValue);
// https://learn.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritefont-hascharacter
// HRESULT HasCharacter( UINT32 unicodeValue, [out] BOOL *exists );
[PreserveSig]
new HRESULT HasCharacter(uint unicodeValue, [MarshalAs(UnmanagedType.Bool)] out bool exists);

/// <summary>Creates a font face object for the font.</summary>
/// <returns>
Expand Down
18 changes: 11 additions & 7 deletions PInvoke/DWrite/Dwrite_2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -954,17 +954,21 @@ public interface IDWriteFont2 : IDWriteFont, IDWriteFont1

/// <summary>Determines whether the font supports a specified character.</summary>
/// <param name="unicodeValue">
/// <para>Type: <c>UINT32</c></para>
/// <para>Type: <b>UINT32</b></para>
/// <para>A Unicode (UCS-4) character value for the method to inspect.</para>
/// </param>
/// <param name="exists">
/// <para>Type: <b>BOOL*</b></para>
/// <para>When this method returns, <b>TRUE</b> if the font supports the specified character; otherwise, <b>FALSE</b>.</para>
/// </param>
/// <returns>
/// <para>Type: <c>bool*</c></para>
/// <para>When this method returns, <c>TRUE</c> if the font supports the specified character; otherwise, <c>FALSE</c>.</para>
/// <para>Type: <b>HRESULT</b></para>
/// <para>If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritefont-hascharacter HRESULT HasCharacter( UINT32
// unicodeValue, bool *exists );
[return: MarshalAs(UnmanagedType.Bool)]
new bool HasCharacter(uint unicodeValue);
// https://learn.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritefont-hascharacter
// HRESULT HasCharacter( UINT32 unicodeValue, [out] BOOL *exists );
[PreserveSig]
new HRESULT HasCharacter(uint unicodeValue, [MarshalAs(UnmanagedType.Bool)] out bool exists);

/// <summary>Creates a font face object for the font.</summary>
/// <returns>
Expand Down
Loading

0 comments on commit 49cde0b

Please sign in to comment.