gpu resource logging command
This commit is contained in:
parent
201d0c2bf0
commit
8745cb4da7
@ -317,7 +317,7 @@ void GC_TickAsync(WaveLaneCtx *lane, AsyncFrameLaneCtx *base_async_lane_frame)
|
|||||||
G_Format_R8G8B8A8_Unorm_Srgb,
|
G_Format_R8G8B8A8_Unorm_Srgb,
|
||||||
atlas->dims,
|
atlas->dims,
|
||||||
G_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present,
|
G_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present,
|
||||||
.debug = Lit("Glyph atlas")
|
.name = Lit("Glyph atlas")
|
||||||
);
|
);
|
||||||
atlas->tex_ref = G_PushTexture2DRef(gpu_perm, atlas->tex);
|
atlas->tex_ref = G_PushTexture2DRef(gpu_perm, atlas->tex);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -422,7 +422,7 @@ Struct(G_BufferDesc)
|
|||||||
{
|
{
|
||||||
G_ResourceFlag flags;
|
G_ResourceFlag flags;
|
||||||
u64 size;
|
u64 size;
|
||||||
String debug;
|
String name;
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(G_TextureDesc)
|
Struct(G_TextureDesc)
|
||||||
@ -433,7 +433,7 @@ Struct(G_TextureDesc)
|
|||||||
G_Layout initial_layout;
|
G_Layout initial_layout;
|
||||||
i32 mip_levels; // Will be clamped to range [1, inf)
|
i32 mip_levels; // Will be clamped to range [1, inf)
|
||||||
Vec4 clear_color;
|
Vec4 clear_color;
|
||||||
String debug;
|
String name;
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(G_SamplerDesc)
|
Struct(G_SamplerDesc)
|
||||||
@ -449,7 +449,7 @@ Struct(G_SamplerDesc)
|
|||||||
Vec4 border_color;
|
Vec4 border_color;
|
||||||
f32 min_lod;
|
f32 min_lod;
|
||||||
f32 max_lod;
|
f32 max_lod;
|
||||||
String debug;
|
String name;
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(G_ResourceDesc)
|
Struct(G_ResourceDesc)
|
||||||
@ -800,6 +800,10 @@ void G_ClearRenderTarget(G_CommandListHandle cl, G_ResourceHandle render_target,
|
|||||||
|
|
||||||
void G_DiscardRenderTarget(G_CommandListHandle cl, G_ResourceHandle render_target);
|
void G_DiscardRenderTarget(G_CommandListHandle cl, G_ResourceHandle render_target);
|
||||||
|
|
||||||
|
//- Log
|
||||||
|
|
||||||
|
void G_LogResource(G_CommandListHandle cl, G_ResourceHandle resource);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ @hookdecl Synchronization
|
//~ @hookdecl Synchronization
|
||||||
|
|
||||||
|
|||||||
@ -450,6 +450,54 @@ D3D12_BARRIER_LAYOUT G_D12_BarrierLayoutFromLayout(G_Layout layout)
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
String G_D12_NameFromBarrierLayout(D3D12_BARRIER_LAYOUT layout)
|
||||||
|
{
|
||||||
|
PERSIST Readonly String names[] = {
|
||||||
|
[D3D12_BARRIER_LAYOUT_COMMON] = CompLit("D3D12_BARRIER_LAYOUT_COMMON"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_PRESENT] = CompLit("D3D12_BARRIER_LAYOUT_PRESENT"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_GENERIC_READ] = CompLit("D3D12_BARRIER_LAYOUT_GENERIC_READ"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_RENDER_TARGET] = CompLit("D3D12_BARRIER_LAYOUT_RENDER_TARGET"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS] = CompLit("D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE] = CompLit("D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ] = CompLit("D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_SHADER_RESOURCE] = CompLit("D3D12_BARRIER_LAYOUT_SHADER_RESOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COPY_SOURCE] = CompLit("D3D12_BARRIER_LAYOUT_COPY_SOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COPY_DEST] = CompLit("D3D12_BARRIER_LAYOUT_COPY_DEST"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE] = CompLit("D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_RESOLVE_DEST] = CompLit("D3D12_BARRIER_LAYOUT_RESOLVE_DEST"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE] = CompLit("D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ] = CompLit("D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE] = CompLit("D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ] = CompLit("D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE] = CompLit("D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ] = CompLit("D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE] = CompLit("D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON] = CompLit("D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ] = CompLit("D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS] = CompLit("D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE] = CompLit("D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE] = CompLit("D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST] = CompLit("D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON] = CompLit("D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ] = CompLit("D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS] = CompLit("D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE] = CompLit("D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE] = CompLit("D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST] = CompLit("D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST"),
|
||||||
|
[D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON] = CompLit("D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON")
|
||||||
|
};
|
||||||
|
String result = Zi;
|
||||||
|
if (layout >= 0 && layout < countof(names))
|
||||||
|
{
|
||||||
|
result = names[layout];
|
||||||
|
}
|
||||||
|
else if (layout == D3D12_BARRIER_LAYOUT_UNDEFINED)
|
||||||
|
{
|
||||||
|
result = Lit("D3D12_BARRIER_LAYOUT_UNDEFINED");
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void G_D12_SetObjectName(ID3D12Object *object, String name)
|
void G_D12_SetObjectName(ID3D12Object *object, String name)
|
||||||
{
|
{
|
||||||
TempArena scratch = BeginScratchNoConflict();
|
TempArena scratch = BeginScratchNoConflict();
|
||||||
@ -464,14 +512,14 @@ String G_D12_NameFromObject(Arena *arena, ID3D12Object *object)
|
|||||||
{
|
{
|
||||||
String result = Zi;
|
String result = Zi;
|
||||||
{
|
{
|
||||||
wchar_t dbg_text[G_D12_MaxDebugTextLen] = Zi;
|
wchar_t name_text[G_D12_MaxNameLen] = Zi;
|
||||||
u32 dbg_text_sz = sizeof(dbg_text);
|
u32 name_text_sz = sizeof(name_text);
|
||||||
ID3D12Object_GetPrivateData(object, &WKPDID_D3DDebugObjectNameW, &dbg_text_sz, dbg_text);
|
ID3D12Object_GetPrivateData(object, &WKPDID_D3DDebugObjectNameW, &name_text_sz, name_text);
|
||||||
if (dbg_text_sz > 2)
|
if (name_text_sz > 2)
|
||||||
{
|
{
|
||||||
String16 str16 = Zi;
|
String16 str16 = Zi;
|
||||||
str16.len = (dbg_text_sz / 2) - 1;
|
str16.len = (name_text_sz / 2) - 1;
|
||||||
str16.text = dbg_text;
|
str16.text = name_text;
|
||||||
result = StringFromString16(arena, str16);
|
result = StringFromString16(arena, str16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -969,11 +1017,11 @@ G_ResourceHandle G_PushResource(G_ArenaHandle arena_handle, G_CommandListHandle
|
|||||||
is_texture ? desc.texture.flags :
|
is_texture ? desc.texture.flags :
|
||||||
desc.sampler.flags;
|
desc.sampler.flags;
|
||||||
|
|
||||||
String new_debug_text =
|
String new_name =
|
||||||
is_buffer ? desc.buffer.debug :
|
is_buffer ? desc.buffer.name :
|
||||||
is_texture ? desc.texture.debug :
|
is_texture ? desc.texture.name :
|
||||||
desc.sampler.debug;
|
desc.sampler.name;
|
||||||
new_debug_text.len = MinU64(new_debug_text.len, countof(resource->debug_text));
|
new_name.len = MinU64(new_name.len, countof(resource->name_text));
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Initialize heap info
|
//- Initialize heap info
|
||||||
@ -1121,9 +1169,9 @@ G_ResourceHandle G_PushResource(G_ArenaHandle arena_handle, G_CommandListHandle
|
|||||||
release->d3d_resource = resource->d3d_resource;
|
release->d3d_resource = resource->d3d_resource;
|
||||||
if (GPU_DEBUG)
|
if (GPU_DEBUG)
|
||||||
{
|
{
|
||||||
StaticAssert(countof(release->debug_text) == countof(resource->debug_text));
|
StaticAssert(countof(release->name_text) == countof(resource->name_text));
|
||||||
release->debug_text_len = resource->debug_text_len;
|
release->name_len = resource->name_len;
|
||||||
CopyBytes(release->debug_text, resource->debug_text, resource->debug_text_len);
|
CopyBytes(release->name_text, resource->name_text, resource->name_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ZeroStruct(resource);
|
ZeroStruct(resource);
|
||||||
@ -1225,21 +1273,27 @@ G_ResourceHandle G_PushResource(G_ArenaHandle arena_handle, G_CommandListHandle
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Set debug information
|
//- Set debug information
|
||||||
|
|
||||||
|
String old_name = STRING(resource->name_len, resource->name_text);
|
||||||
|
if (!MatchString(old_name, new_name))
|
||||||
|
{
|
||||||
|
resource->name_len = new_name.len;
|
||||||
|
CopyBytes(resource->name_text, new_name.text, new_name.len);
|
||||||
if (GPU_DEBUG)
|
if (GPU_DEBUG)
|
||||||
{
|
{
|
||||||
String old_debug_text = STRING(resource->debug_text_len, resource->debug_text);
|
G_D12_SetObjectName((ID3D12Object *)resource->d3d_resource, new_name);
|
||||||
if (!MatchString(old_debug_text, new_debug_text))
|
|
||||||
{
|
|
||||||
resource->debug_text_len = new_debug_text.len;
|
|
||||||
CopyBytes(resource->debug_text, new_debug_text.text, new_debug_text.len);
|
|
||||||
G_D12_SetObjectName((ID3D12Object *)resource->d3d_resource, new_debug_text);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Barrier if reusing
|
//- Barrier reused resource
|
||||||
|
|
||||||
|
// TODO: These barriers are overly cautious. It's unlikely that anything
|
||||||
|
// other than an activation-layout transition is needed for textures, since
|
||||||
|
// arenas are rarely reset in the middle of a command list. In the case that
|
||||||
|
// a resource is reused within the same command list, we should insert
|
||||||
|
// barriers as described in the spec:
|
||||||
|
// https://microsoft.github.io/DirectX-Specs/d3d/D3D12EnhancedBarriers.html#resource-aliasing
|
||||||
|
|
||||||
// TODO: These barriers are too cautious; it's rare that an arena would ever be reset mid-command list.
|
|
||||||
if (can_reuse)
|
if (can_reuse)
|
||||||
{
|
{
|
||||||
if (is_buffer)
|
if (is_buffer)
|
||||||
@ -1922,7 +1976,7 @@ i64 G_CommitCommandList(G_CommandListHandle cl_handle)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process gpu commands into dx12 commands
|
// Build d3d commands
|
||||||
{
|
{
|
||||||
u64 batch_barrier_idx_start = 0;
|
u64 batch_barrier_idx_start = 0;
|
||||||
u64 batch_barrier_idx_opl = 0; // One past last
|
u64 batch_barrier_idx_opl = 0; // One past last
|
||||||
@ -2431,6 +2485,24 @@ i64 G_CommitCommandList(G_CommandListHandle cl_handle)
|
|||||||
ID3D12GraphicsCommandList_DiscardResource(d3d_cl, resource->d3d_resource, 0);
|
ID3D12GraphicsCommandList_DiscardResource(d3d_cl, resource->d3d_resource, 0);
|
||||||
cmd_idx += 1;
|
cmd_idx += 1;
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
//- Log
|
||||||
|
|
||||||
|
case G_D12_CmdKind_Log:
|
||||||
|
{
|
||||||
|
G_D12_Resource *resource = cmd->log.resource;
|
||||||
|
String resource_name = STRING(resource->name_len, resource->name_text);
|
||||||
|
String layout_name = G_D12_NameFromBarrierLayout(resource->cmdlist_texture_layout);
|
||||||
|
String msg = StringF(
|
||||||
|
scratch.arena,
|
||||||
|
"[Gpu command list resource log] uid: %F, name: \"%F\", layout: %F",
|
||||||
|
FmtUint(resource->uid),
|
||||||
|
FmtString(resource_name),
|
||||||
|
FmtString(layout_name)
|
||||||
|
);
|
||||||
|
LogDebug(msg);
|
||||||
|
cmd_idx += 1;
|
||||||
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2814,6 +2886,16 @@ void G_DiscardRenderTarget(G_CommandListHandle cl_handle, G_ResourceHandle resou
|
|||||||
cmd->discard_rtv.render_target = G_D12_ResourceFromHandle(resource_handle);
|
cmd->discard_rtv.render_target = G_D12_ResourceFromHandle(resource_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- Log
|
||||||
|
|
||||||
|
void G_LogResource(G_CommandListHandle cl_handle, G_ResourceHandle resource_handle)
|
||||||
|
{
|
||||||
|
G_D12_CmdList *cl = G_D12_CmdListFromHandle(cl_handle);
|
||||||
|
G_D12_Cmd *cmd = G_D12_PushCmd(cl);
|
||||||
|
cmd->kind = G_D12_CmdKind_Log;
|
||||||
|
cmd->log.resource = G_D12_ResourceFromHandle(resource_handle);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ @hookimpl Synchronization
|
//~ @hookimpl Synchronization
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
#define G_D12_MaxSamplerDescriptors (1024 * 1)
|
#define G_D12_MaxSamplerDescriptors (1024 * 1)
|
||||||
#define G_D12_MaxRtvDescriptors (1024 * 64)
|
#define G_D12_MaxRtvDescriptors (1024 * 64)
|
||||||
|
|
||||||
#define G_D12_MaxDebugTextLen 64
|
#define G_D12_MaxNameLen 64
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
//~ Pipeline types
|
//~ Pipeline types
|
||||||
@ -93,8 +93,8 @@ Struct(G_D12_Resource)
|
|||||||
// Backbuffer info
|
// Backbuffer info
|
||||||
struct G_D12_Swapchain *swapchain;
|
struct G_D12_Swapchain *swapchain;
|
||||||
|
|
||||||
u64 debug_text_len;
|
u64 name_len;
|
||||||
u8 debug_text[G_D12_MaxDebugTextLen];
|
u8 name_text[G_D12_MaxNameLen];
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(G_D12_ResourceList)
|
Struct(G_D12_ResourceList)
|
||||||
@ -279,8 +279,8 @@ Struct(G_D12_Releasable)
|
|||||||
|
|
||||||
ID3D12Resource *d3d_resource;
|
ID3D12Resource *d3d_resource;
|
||||||
|
|
||||||
u64 debug_text_len;
|
u64 name_len;
|
||||||
u8 debug_text[G_D12_MaxDebugTextLen];
|
u8 name_text[G_D12_MaxNameLen];
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(G_D12_ReleasableList)
|
Struct(G_D12_ReleasableList)
|
||||||
@ -305,6 +305,7 @@ Enum(G_D12_CmdKind)
|
|||||||
G_D12_CmdKind_Rasterize,
|
G_D12_CmdKind_Rasterize,
|
||||||
G_D12_CmdKind_ClearRtv,
|
G_D12_CmdKind_ClearRtv,
|
||||||
G_D12_CmdKind_DiscardRtv,
|
G_D12_CmdKind_DiscardRtv,
|
||||||
|
G_D12_CmdKind_Log,
|
||||||
};
|
};
|
||||||
|
|
||||||
Struct(G_D12_Cmd)
|
Struct(G_D12_Cmd)
|
||||||
@ -374,6 +375,11 @@ Struct(G_D12_Cmd)
|
|||||||
{
|
{
|
||||||
G_D12_Resource *render_target;
|
G_D12_Resource *render_target;
|
||||||
} discard_rtv;
|
} discard_rtv;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
G_D12_Resource *resource;
|
||||||
|
} log;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -502,6 +508,7 @@ DXGI_FORMAT G_D12_DxgiFormatFromGpuFormat(G_Format format);
|
|||||||
D3D12_BARRIER_SYNC G_D12_BarrierSyncFromStages(G_Stage stages);
|
D3D12_BARRIER_SYNC G_D12_BarrierSyncFromStages(G_Stage stages);
|
||||||
D3D12_BARRIER_ACCESS G_D12_BarrierAccessFromAccesses(G_Access accesses);
|
D3D12_BARRIER_ACCESS G_D12_BarrierAccessFromAccesses(G_Access accesses);
|
||||||
D3D12_BARRIER_LAYOUT G_D12_BarrierLayoutFromLayout(G_Layout layout);
|
D3D12_BARRIER_LAYOUT G_D12_BarrierLayoutFromLayout(G_Layout layout);
|
||||||
|
String G_D12_NameFromBarrierLayout(D3D12_BARRIER_LAYOUT layout);
|
||||||
|
|
||||||
void G_D12_SetObjectName(ID3D12Object *object, String name);
|
void G_D12_SetObjectName(ID3D12Object *object, String name);
|
||||||
String G_D12_NameFromObject(Arena *arena, ID3D12Object *object);
|
String G_D12_NameFromObject(Arena *arena, ID3D12Object *object);
|
||||||
|
|||||||
@ -426,7 +426,6 @@ void BuildEntryPoint(WaveLaneCtx *lane)
|
|||||||
//- Dxc
|
//- Dxc
|
||||||
{
|
{
|
||||||
PushStringToList(perm, &cp.flags_dxc, Lit("-O3"));
|
PushStringToList(perm, &cp.flags_dxc, Lit("-O3"));
|
||||||
// PushStringToList(perm, &cp.flags_dxc, Lit("-Od"));
|
|
||||||
PushStringToList(perm, &cp.flags_dxc, Lit("-Zi -Qembed_debug"));
|
PushStringToList(perm, &cp.flags_dxc, Lit("-Zi -Qembed_debug"));
|
||||||
|
|
||||||
// Enable warnings
|
// Enable warnings
|
||||||
|
|||||||
@ -412,7 +412,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
V_GpuState,
|
V_GpuState,
|
||||||
1,
|
1,
|
||||||
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
||||||
.debug = Lit("Gpu state")
|
.name = Lit("Gpu state")
|
||||||
);
|
);
|
||||||
gpu_state_ref = G_PushRWStructuredBufferRef(gpu_perm, gpu_state, V_GpuState);
|
gpu_state_ref = G_PushRWStructuredBufferRef(gpu_perm, gpu_state, V_GpuState);
|
||||||
}
|
}
|
||||||
@ -424,7 +424,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
tiles_dims,
|
tiles_dims,
|
||||||
G_Layout_DirectQueue_ShaderRead,
|
G_Layout_DirectQueue_ShaderRead,
|
||||||
.flags = G_ResourceFlag_ZeroMemory,
|
.flags = G_ResourceFlag_ZeroMemory,
|
||||||
.debug = Lit("Tiles")
|
.name = Lit("Tiles")
|
||||||
);
|
);
|
||||||
gpu_tiles_ref = G_PushTexture2DRef(gpu_perm, gpu_tiles);
|
gpu_tiles_ref = G_PushTexture2DRef(gpu_perm, gpu_tiles);
|
||||||
}
|
}
|
||||||
@ -435,7 +435,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
V_Particle,
|
V_Particle,
|
||||||
V_ParticlesCap,
|
V_ParticlesCap,
|
||||||
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
||||||
.debug = Lit("Particles")
|
.name = Lit("Particles")
|
||||||
);
|
);
|
||||||
gpu_particles_ref = G_PushRWStructuredBufferRef(gpu_perm, gpu_particles, V_Particle);
|
gpu_particles_ref = G_PushRWStructuredBufferRef(gpu_perm, gpu_particles, V_Particle);
|
||||||
}
|
}
|
||||||
@ -450,7 +450,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
cells_dims,
|
cells_dims,
|
||||||
G_Layout_DirectQueue_ShaderReadWrite,
|
G_Layout_DirectQueue_ShaderReadWrite,
|
||||||
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
||||||
.debug = Lit("Cells")
|
.name = Lit("Cells")
|
||||||
);
|
);
|
||||||
gpu_cells_ref = G_PushRWTexture2DRef(gpu_perm, gpu_cells);
|
gpu_cells_ref = G_PushRWTexture2DRef(gpu_perm, gpu_cells);
|
||||||
}
|
}
|
||||||
@ -465,7 +465,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
cells_dims,
|
cells_dims,
|
||||||
G_Layout_DirectQueue_ShaderReadWrite,
|
G_Layout_DirectQueue_ShaderReadWrite,
|
||||||
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
||||||
.debug = Lit("Stains")
|
.name = Lit("Stains")
|
||||||
);
|
);
|
||||||
gpu_stains_ref = G_PushRWTexture2DRef(gpu_perm, gpu_stains);
|
gpu_stains_ref = G_PushRWTexture2DRef(gpu_perm, gpu_stains);
|
||||||
}
|
}
|
||||||
@ -481,7 +481,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
cells_dims,
|
cells_dims,
|
||||||
G_Layout_DirectQueue_ShaderReadWrite,
|
G_Layout_DirectQueue_ShaderReadWrite,
|
||||||
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
.flags = G_ResourceFlag_ZeroMemory | G_ResourceFlag_AllowShaderReadWrite,
|
||||||
.debug = Lit("Drynesses")
|
.name = Lit("Drynesses")
|
||||||
);
|
);
|
||||||
gpu_drynesses_ref = G_PushRWTexture2DRef(gpu_perm, gpu_drynesses);
|
gpu_drynesses_ref = G_PushRWTexture2DRef(gpu_perm, gpu_drynesses);
|
||||||
}
|
}
|
||||||
@ -4453,7 +4453,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
frame->screen_dims,
|
frame->screen_dims,
|
||||||
G_Layout_DirectQueue_RenderTargetWrite,
|
G_Layout_DirectQueue_RenderTargetWrite,
|
||||||
.flags = G_ResourceFlag_AllowRenderTarget,
|
.flags = G_ResourceFlag_AllowRenderTarget,
|
||||||
.debug = StringF(frame->arena, "Screen target [%F]", FmtSint(frame->tick))
|
.name = StringF(frame->arena, "Screen target [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
G_Texture2DRef screen_target_ro = G_PushTexture2DRef(frame->gpu_arena, screen_target);
|
G_Texture2DRef screen_target_ro = G_PushTexture2DRef(frame->gpu_arena, screen_target);
|
||||||
Rng3 screen_viewport = RNG3(VEC3(0, 0, 0), VEC3(frame->screen_dims.x, frame->screen_dims.y, 1));
|
Rng3 screen_viewport = RNG3(VEC3(0, 0, 0), VEC3(frame->screen_dims.x, frame->screen_dims.y, 1));
|
||||||
@ -4466,7 +4466,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
frame->screen_dims,
|
frame->screen_dims,
|
||||||
G_Layout_DirectQueue_RenderTargetWrite,
|
G_Layout_DirectQueue_RenderTargetWrite,
|
||||||
.flags = G_ResourceFlag_AllowRenderTarget,
|
.flags = G_ResourceFlag_AllowRenderTarget,
|
||||||
.debug = StringF(frame->arena, "Albedo target [%F]", FmtSint(frame->tick))
|
.name = StringF(frame->arena, "Albedo target [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
G_Texture2DRef albedo_target_ro = G_PushTexture2DRef(frame->gpu_arena, albedo_target);
|
G_Texture2DRef albedo_target_ro = G_PushTexture2DRef(frame->gpu_arena, albedo_target);
|
||||||
|
|
||||||
@ -4477,7 +4477,9 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
frame->shade_dims,
|
frame->shade_dims,
|
||||||
G_Layout_DirectQueue_ShaderReadWrite,
|
G_Layout_DirectQueue_ShaderReadWrite,
|
||||||
.flags = G_ResourceFlag_AllowShaderReadWrite,
|
.flags = G_ResourceFlag_AllowShaderReadWrite,
|
||||||
.debug = StringF(frame->arena, "Shade target [%F]", FmtSint(frame->tick))
|
// FIXME: Remove this
|
||||||
|
// .flags = G_ResourceFlag_AllowShaderReadWrite | G_ResourceFlag_ForceNoReuse,
|
||||||
|
.name = StringF(frame->arena, "Shade target [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
G_Texture2DRef shade_target_ro = G_PushTexture2DRef(frame->gpu_arena, shade_target);
|
G_Texture2DRef shade_target_ro = G_PushTexture2DRef(frame->gpu_arena, shade_target);
|
||||||
G_RWTexture2DRef shade_target_rw = G_PushRWTexture2DRef(frame->gpu_arena, shade_target);
|
G_RWTexture2DRef shade_target_rw = G_PushRWTexture2DRef(frame->gpu_arena, shade_target);
|
||||||
@ -4488,7 +4490,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
G_ResourceHandle quads_buff = G_PushBufferFromCpuCopy(
|
G_ResourceHandle quads_buff = G_PushBufferFromCpuCopy(
|
||||||
frame->gpu_arena, frame->cl,
|
frame->gpu_arena, frame->cl,
|
||||||
StringFromArena(frame->quads_arena),
|
StringFromArena(frame->quads_arena),
|
||||||
.debug = StringF(frame->arena, "quads [%F]", FmtSint(frame->tick))
|
.name = StringF(frame->arena, "quads [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
G_StructuredBufferRef quads_ref = G_PushStructuredBufferRef(frame->gpu_arena, quads_buff, V_Quad);
|
G_StructuredBufferRef quads_ref = G_PushStructuredBufferRef(frame->gpu_arena, quads_buff, V_Quad);
|
||||||
|
|
||||||
@ -4496,12 +4498,12 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
G_ResourceHandle dverts_buff = G_PushBufferFromCpuCopy(
|
G_ResourceHandle dverts_buff = G_PushBufferFromCpuCopy(
|
||||||
frame->gpu_arena, frame->cl,
|
frame->gpu_arena, frame->cl,
|
||||||
StringFromArena(frame->dverts_arena),
|
StringFromArena(frame->dverts_arena),
|
||||||
.debug = StringF(frame->arena, "dverts [%F]", FmtSint(frame->tick))
|
.name = StringF(frame->arena, "dverts [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
G_ResourceHandle dvert_idxs_buff = G_PushBufferFromCpuCopy(
|
G_ResourceHandle dvert_idxs_buff = G_PushBufferFromCpuCopy(
|
||||||
frame->gpu_arena, frame->cl,
|
frame->gpu_arena, frame->cl,
|
||||||
StringFromArena(frame->dvert_idxs_arena),
|
StringFromArena(frame->dvert_idxs_arena),
|
||||||
.debug = StringF(frame->arena, "dvert idxs [%F]", FmtSint(frame->tick))
|
.name = StringF(frame->arena, "dvert idxs [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
G_StructuredBufferRef dverts_ref = G_PushStructuredBufferRef(frame->gpu_arena, dverts_buff, V_DVert);
|
G_StructuredBufferRef dverts_ref = G_PushStructuredBufferRef(frame->gpu_arena, dverts_buff, V_DVert);
|
||||||
G_IndexBufferDesc dvert_idxs_ib = G_IdxBuff32(dvert_idxs_buff);
|
G_IndexBufferDesc dvert_idxs_ib = G_IdxBuff32(dvert_idxs_buff);
|
||||||
@ -4522,7 +4524,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
gpu_emitters = G_PushBufferFromCpuCopy(
|
gpu_emitters = G_PushBufferFromCpuCopy(
|
||||||
frame->gpu_arena, frame->cl,
|
frame->gpu_arena, frame->cl,
|
||||||
StringFromStructs(flattened_emitters, frame->emitters_count),
|
StringFromStructs(flattened_emitters, frame->emitters_count),
|
||||||
.debug = StringF(frame->arena, "emitters [%F]", FmtSint(frame->tick))
|
.name = StringF(frame->arena, "emitters [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
G_StructuredBufferRef gpu_emitters_ref = G_PushStructuredBufferRef(frame->gpu_arena, gpu_emitters, V_Emitter);
|
G_StructuredBufferRef gpu_emitters_ref = G_PushStructuredBufferRef(frame->gpu_arena, gpu_emitters, V_Emitter);
|
||||||
@ -4602,7 +4604,7 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
G_ResourceHandle gpu_params = G_PushBufferFromCpuCopy(
|
G_ResourceHandle gpu_params = G_PushBufferFromCpuCopy(
|
||||||
frame->gpu_arena, frame->cl,
|
frame->gpu_arena, frame->cl,
|
||||||
StringFromStruct(¶ms),
|
StringFromStruct(¶ms),
|
||||||
.debug = StringF(frame->arena, "Gpu params [%F]", FmtSint(frame->tick))
|
.name = StringF(frame->arena, "Gpu params [%F]", FmtSint(frame->tick))
|
||||||
);
|
);
|
||||||
G_StructuredBufferRef gpu_params_ref = G_PushStructuredBufferRef(frame->gpu_arena, gpu_params, V_GpuParams);
|
G_StructuredBufferRef gpu_params_ref = G_PushStructuredBufferRef(frame->gpu_arena, gpu_params, V_GpuParams);
|
||||||
|
|
||||||
|
|||||||
@ -430,7 +430,7 @@ void SPR_TickAsync(WaveLaneCtx *lane, AsyncFrameLaneCtx *base_async_lane_frame)
|
|||||||
G_Format_R8G8B8A8_Unorm_Srgb,
|
G_Format_R8G8B8A8_Unorm_Srgb,
|
||||||
atlas->dims,
|
atlas->dims,
|
||||||
G_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present,
|
G_Layout_AnyQueue_ShaderRead_CopyRead_CopyWrite_Present,
|
||||||
.debug = Lit("Sprite atlas")
|
.name = Lit("Sprite atlas")
|
||||||
);
|
);
|
||||||
atlas->tex_ref = G_PushTexture2DRef(gpu_perm, atlas->tex);
|
atlas->tex_ref = G_PushTexture2DRef(gpu_perm, atlas->tex);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1671,7 +1671,7 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync)
|
|||||||
monitor_size,
|
monitor_size,
|
||||||
G_Layout_DirectQueue_RenderTargetWrite,
|
G_Layout_DirectQueue_RenderTargetWrite,
|
||||||
.flags = G_ResourceFlag_AllowRenderTarget,
|
.flags = G_ResourceFlag_AllowRenderTarget,
|
||||||
.debug = Lit("UI draw target")
|
.name = Lit("UI draw target")
|
||||||
);
|
);
|
||||||
G_Texture2DRef draw_target_ro = G_PushTexture2DRef(frame->gpu_arena, draw_target);
|
G_Texture2DRef draw_target_ro = G_PushTexture2DRef(frame->gpu_arena, draw_target);
|
||||||
|
|
||||||
@ -1680,7 +1680,7 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync)
|
|||||||
G_ResourceHandle rects_buff = G_PushBufferFromCpuCopy(
|
G_ResourceHandle rects_buff = G_PushBufferFromCpuCopy(
|
||||||
frame->gpu_arena, frame->cl,
|
frame->gpu_arena, frame->cl,
|
||||||
StringFromArena(frame->rects_arena),
|
StringFromArena(frame->rects_arena),
|
||||||
.debug = Lit("UI rects")
|
.name = Lit("UI rects")
|
||||||
);
|
);
|
||||||
G_StructuredBufferRef rects_ro = G_PushStructuredBufferRef(frame->gpu_arena, rects_buff, UI_GpuRect);
|
G_StructuredBufferRef rects_ro = G_PushStructuredBufferRef(frame->gpu_arena, rects_buff, UI_GpuRect);
|
||||||
|
|
||||||
@ -1697,7 +1697,7 @@ void UI_EndFrame(UI_Frame *frame, i32 vsync)
|
|||||||
G_ResourceHandle params_buff = G_PushBufferFromCpuCopy(
|
G_ResourceHandle params_buff = G_PushBufferFromCpuCopy(
|
||||||
frame->gpu_arena, frame->cl,
|
frame->gpu_arena, frame->cl,
|
||||||
StringFromStruct(¶ms),
|
StringFromStruct(¶ms),
|
||||||
.debug = Lit("UI gpu params")
|
.name = Lit("UI gpu params")
|
||||||
);
|
);
|
||||||
G_StructuredBufferRef params_ro = G_PushStructuredBufferRef(frame->gpu_arena, params_buff, UI_GpuParams);
|
G_StructuredBufferRef params_ro = G_PushStructuredBufferRef(frame->gpu_arena, params_buff, UI_GpuParams);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user