Debug Naming API

what_if_no_video_threads
cosmonaut 2024-03-11 16:11:12 -07:00
parent 23b6499479
commit 217ae96888
3 changed files with 35 additions and 1 deletions

@ -1 +1 @@
Subproject commit 1bf28f4397d1a8bc19a75d608f4022541af2080d Subproject commit 995a54fa2df82946441c9ec6446d7cd12236f8f7

View File

@ -16,6 +16,22 @@ namespace MoonWorks.Graphics
/// </summary> /// </summary>
public uint Size { get; } public uint Size { get; }
private string name;
public string Name
{
get => name;
set
{
Refresh.Refresh_SetGpuBufferName(
Device.Handle,
Handle,
value
);
name = value;
}
}
/// <summary> /// <summary>
/// Creates a buffer of appropriate size given a type and element count. /// Creates a buffer of appropriate size given a type and element count.
/// </summary> /// </summary>
@ -55,6 +71,7 @@ namespace MoonWorks.Graphics
sizeInBytes sizeInBytes
); );
Size = sizeInBytes; Size = sizeInBytes;
name = "";
} }
public static implicit operator BufferBinding(GpuBuffer b) public static implicit operator BufferBinding(GpuBuffer b)

View File

@ -20,6 +20,22 @@ namespace MoonWorks.Graphics
public TextureUsageFlags UsageFlags { get; } public TextureUsageFlags UsageFlags { get; }
public uint Size { get; } public uint Size { get; }
private string name;
public string Name
{
get => name;
set
{
Refresh.Refresh_SetTextureName(
Device.Handle,
Handle,
value
);
name = value;
}
}
// FIXME: this allocates a delegate instance // FIXME: this allocates a delegate instance
protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyTexture; protected override Action<IntPtr, IntPtr> QueueDestroyFunction => Refresh.Refresh_QueueDestroyTexture;
@ -174,6 +190,7 @@ namespace MoonWorks.Graphics
SampleCount = textureCreateInfo.SampleCount; SampleCount = textureCreateInfo.SampleCount;
UsageFlags = textureCreateInfo.UsageFlags; UsageFlags = textureCreateInfo.UsageFlags;
Size = Width * Height * BytesPerPixel(Format) / BlockSizeSquared(Format); Size = Width * Height * BytesPerPixel(Format) / BlockSizeSquared(Format);
name = "";
} }
// Used by Window. Swapchain texture handles are managed by the driver backend. // Used by Window. Swapchain texture handles are managed by the driver backend.