working buffer copy

This commit is contained in:
jacob 2025-12-02 22:29:35 -06:00
parent f0f3da0bcd
commit 7bb5447abf
4 changed files with 661 additions and 499 deletions

File diff suppressed because it is too large Load Diff

View File

@ -124,6 +124,7 @@ Struct(GPU_D12_Arena)
Struct(GPU_D12_Resource)
{
GPU_D12_Resource *next_free;
ID3D12Resource *d3d_resource;
u64 uid;
GPU_ResourceFlag flags;
@ -139,6 +140,9 @@ Struct(GPU_D12_Resource)
i32 texture_mip_levels;
D3D12_BARRIER_LAYOUT texture_layout;
/* Sampler info */
GPU_SamplerDesc sampler_desc;
/* Backbuffer info */
struct GPU_D12_Swapchain *swapchain;
};
@ -229,7 +233,8 @@ Enum(GPU_D12_CmdKind)
GPU_D12_CmdKind_None,
GPU_D12_CmdKind_Barrier,
GPU_D12_CmdKind_Constant,
GPU_D12_CmdKind_Copy,
GPU_D12_CmdKind_CopyBytes,
GPU_D12_CmdKind_CopyTexels,
GPU_D12_CmdKind_Compute,
GPU_D12_CmdKind_Rasterize,
GPU_D12_CmdKind_ClearRtv,
@ -261,8 +266,7 @@ Struct(GPU_D12_Cmd)
GPU_D12_Resource *dst;
GPU_D12_Resource *src;
u64 dst_offset;
u64 src_offset;
u64 size;
RngU64 src_copy_range;
} copy_bytes;
struct
@ -270,8 +274,7 @@ Struct(GPU_D12_Cmd)
GPU_D12_Resource *dst;
GPU_D12_Resource *src;
Vec3I32 dst_offset;
Vec3I32 src_offset;
Vec3I32 size;
Rng3I32 src_copy_range;
} copy_texels;
struct
@ -385,7 +388,7 @@ Struct(GPU_D12_SharedState)
////////////////////////////////////////////////////////////
//~ Helpers
#define GPU_D12_HandleFromPointer(type, ptr) (type) { .v = (u64)(ptr) }
#define GPU_D12_MakeHandle(type, ptr) (type) { .v = (u64)(ptr) }
GPU_D12_Arena *GPU_D12_ArenaFromHandle(GPU_ArenaHandle handle);
GPU_D12_CmdList *GPU_D12_CmdListFromHandle(GPU_CommandListHandle handle);

View File

@ -68,7 +68,6 @@ JobImpl(PT_RunForever, _sig, _id)
PT_BlitVS, PT_BlitPS,
1, GPU_GetCommonQuadIndices(),
backbuffer, GPU_RasterMode_TriangleList);
GPU_ClearRenderTarget(cl, backbuffer, VEC4(1, 0, 0, 1));
}
/* Finalize backbuffer layout */

View File

@ -40,7 +40,6 @@ Struct(PT_BlitPSOutput)
VertexShader(PT_BlitVS, PT_BlitPSInput)
{
Vec2 uv = RectUvFromVertexId(SV_VertexID);
PT_BlitPSInput result;
result.SV_Position = Vec4(NdcFromUv(uv).xy, 0, 1);
result.src_uv = uv;