D3D11 support

what_if_no_video_threads
cosmonaut 2024-03-05 16:17:29 -08:00
parent 019afa91f5
commit c84752f38c
9 changed files with 4 additions and 90 deletions

@ -1 +1 @@
Subproject commit 86cc5fa1422c8b79c436c4e4fc345114e9615dbb
Subproject commit 7465d4d4de1a0f2c5de5a2d0b3240671e83776d1

View File

@ -53,6 +53,7 @@ namespace MoonWorks
public Game(
WindowCreateInfo windowCreateInfo,
FrameLimiterSettings frameLimiterSettings,
Backend backend = Backend.Vulkan,
int targetTimestep = 60,
bool debugMode = false
)
@ -82,7 +83,7 @@ namespace MoonWorks
Logger.LogInfo("Initializing graphics device...");
GraphicsDevice = new GraphicsDevice(
Backend.Vulkan,
backend,
debugMode
);

View File

@ -2087,94 +2087,6 @@ namespace MoonWorks.Graphics
);
}
/// <summary>
/// Copies the contents of a Texture to a GpuBuffer.
/// This copy occurs on the GPU timeline.
///
/// You MAY assume that the copy has finished in subsequent commands.
/// </summary>
public void CopyTextureToBuffer(
in TextureRegion textureRegion,
GpuBuffer buffer,
in BufferImageCopy copyParams,
WriteOptions option
) {
#if DEBUG
AssertNotSubmitted();
AssertInCopyPass("Cannot download from texture outside of copy pass!");
AssertBufferBoundsCheck(buffer.Size, copyParams.BufferOffset, textureRegion.Size);
#endif
Refresh.Refresh_CopyTextureToBuffer(
Device.Handle,
Handle,
textureRegion.ToRefreshTextureRegion(),
buffer.Handle,
copyParams.ToRefresh(),
(Refresh.WriteOptions) option
);
}
/// <summary>
/// Copies the entire contents of a Texture to a GpuBuffer.
/// </summary>
public void CopyTextureToBuffer(
Texture texture,
GpuBuffer buffer,
WriteOptions option
) {
CopyTextureToBuffer(
new TextureRegion(texture),
buffer,
new BufferImageCopy(0, 0, 0),
option
);
}
/// <summary>
/// Copies the contents of a GpuBuffer to a Texture.
/// This copy occurs on the GPU timeline.
///
/// You MAY assume that the copy has finished in subsequent commands.
/// </summary>
public void CopyBufferToTexture(
GpuBuffer gpuBuffer,
in TextureRegion textureRegion,
in BufferImageCopy copyParams,
WriteOptions option
) {
#if DEBUG
AssertNotSubmitted();
AssertInCopyPass("Cannot download from texture outside of copy pass!");
AssertBufferBoundsCheck(gpuBuffer.Size, copyParams.BufferOffset, textureRegion.Size);
#endif
Refresh.Refresh_CopyBufferToTexture(
Device.Handle,
Handle,
gpuBuffer.Handle,
textureRegion.ToRefreshTextureRegion(),
copyParams.ToRefresh(),
(Refresh.WriteOptions) option
);
}
/// <summary>
/// Copies the entire contents of a Texture with no mips to a GpuBuffer.
/// </summary>
public void CopyBufferToTexture(
GpuBuffer buffer,
Texture texture,
WriteOptions option
) {
CopyBufferToTexture(
buffer,
new TextureRegion(texture),
new BufferImageCopy(0, 0, 0),
option
);
}
/// <summary>
/// Copies data from a GpuBuffer to another GpuBuffer.
/// This copy occurs on the GPU timeline.

View File

@ -313,6 +313,7 @@ namespace MoonWorks.Graphics
{
DontCare,
Vulkan,
D3D11,
PS5,
Invalid
}