Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Apr 15, 2024
1 parent 5c271b2 commit 00d1de9
Show file tree
Hide file tree
Showing 16 changed files with 1,123 additions and 1,386 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
if not exist ../out/pl_image_ext.dll exit 1
if not exist ../out/pl_stats_ext.dll exit 1
if not exist ../out/pl_debug_ext.dll exit 1
if not exist ../out/pl_gpu_allocators_ext.dll exit 1
if not exist ../out/pl_resource_ext.dll exit 1
if not exist ../out/pl_ecs_ext.dll exit 1
if not exist ../out/pl_ref_renderer_ext.dll exit 1
Expand Down Expand Up @@ -102,6 +103,7 @@ jobs:
test -f ./out/pl_image_ext.dylib || exit 1
test -f ./out/pl_debug_ext.dylib || exit 1
test -f ./out/pl_graphics_ext.dylib || exit 1
test -f ./out/pl_gpu_allocators_ext.dylib || exit 1
test -f ./out/pl_resource_ext.dylib || exit 1
test -f ./out/pl_ecs_ext.dylib || exit 1
test -f ./out/pl_ref_renderer_ext.dylib || exit 1
Expand Down Expand Up @@ -165,6 +167,7 @@ jobs:
test -f ./out/pl_image_ext.so || exit 1
test -f ./out/pl_stats_ext.so || exit 1
test -f ./out/pl_debug_ext.so || exit 1
test -f ./out/pl_gpu_allocators_ext.so || exit 1
test -f ./out/pl_resource_ext.so || exit 1
test -f ./out/pl_ecs_ext.so || exit 1
test -f ./out/pl_ref_renderer_ext.so || exit 1
Expand Down
15 changes: 8 additions & 7 deletions apps/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,14 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// load extensions
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
ptExtensionRegistry->load("pl_image_ext", "pl_load_image_ext", "pl_unload_image_ext", false);
ptExtensionRegistry->load("pl_stats_ext", "pl_load_stats_ext", "pl_unload_stats_ext", false);
ptExtensionRegistry->load("pl_graphics_ext", "pl_load_graphics_ext", "pl_unload_graphics_ext", false);
ptExtensionRegistry->load("pl_debug_ext", "pl_load_debug_ext", "pl_unload_debug_ext", true);
ptExtensionRegistry->load("pl_ecs_ext", "pl_load_ecs_ext", "pl_unload_ecs_ext", false);
ptExtensionRegistry->load("pl_resource_ext", "pl_load_resource_ext", "pl_unload_resource_ext", false);
ptExtensionRegistry->load("pl_ref_renderer_ext", "pl_load_ext", "pl_unload_ext", true);
ptExtensionRegistry->load("pl_image_ext", NULL, NULL, false);
ptExtensionRegistry->load("pl_stats_ext", NULL, NULL, false);
ptExtensionRegistry->load("pl_graphics_ext", NULL, NULL, false);
ptExtensionRegistry->load("pl_gpu_allocators_ext", NULL, NULL, false);
ptExtensionRegistry->load("pl_debug_ext", NULL, NULL, true);
ptExtensionRegistry->load("pl_ecs_ext", NULL, NULL, false);
ptExtensionRegistry->load("pl_resource_ext", NULL, NULL, false);
ptExtensionRegistry->load("pl_ref_renderer_ext", NULL, NULL, true);

// load apis
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
Expand Down
21 changes: 12 additions & 9 deletions extensions/pl_debug_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ Index of this file:
#include "pl_ui_internal.h"
#include "pl_stats_ext.h"
#include "pl_graphics_ext.h"
#include "pl_gpu_allocators_ext.h"

//-----------------------------------------------------------------------------
// [SECTION] global data
//-----------------------------------------------------------------------------

// apis
static const plApiRegistryI* gptApiRegistry = NULL;
static const plStatsI* ptStatsApi = NULL;
static const plDataRegistryI* ptDataRegistry = NULL;
static const plApiRegistryI* gptApiRegistry = NULL;
static const plStatsI* ptStatsApi = NULL;
static const plDataRegistryI* ptDataRegistry = NULL;
static const plGPUAllocatorsI* gptGpuAllocators = NULL;

// contexts
static plMemoryContext* ptMemoryCtx = NULL;
Expand Down Expand Up @@ -803,10 +805,10 @@ pl__show_device_memory(bool* bValue)
pl_text("Host Memory: %llu bytes", (double)ptDevice->ptGraphics->szHostMemoryInUse);

const plDeviceMemoryAllocatorI atAllocators[] = {
ptDevice->tLocalBuddyAllocator,
ptDevice->tLocalDedicatedAllocator,
ptDevice->tStagingUnCachedAllocator,
ptDevice->tStagingCachedAllocator
*gptGpuAllocators->create_local_buddy_allocator(ptDevice),
*gptGpuAllocators->create_local_dedicated_allocator(ptDevice),
*gptGpuAllocators->create_staging_uncached_allocator(ptDevice),
*gptGpuAllocators->create_staging_uncached_allocator(ptDevice)
};

const char* apcAllocatorNames[] = {
Expand Down Expand Up @@ -1061,7 +1063,7 @@ pl__show_logging(bool* bValue)
//-----------------------------------------------------------------------------

PL_EXPORT void
pl_load_debug_ext(plApiRegistryI* ptApiRegistry, bool bReload)
pl_load_ext(plApiRegistryI* ptApiRegistry, bool bReload)
{
gptApiRegistry = ptApiRegistry;
ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
Expand All @@ -1072,6 +1074,7 @@ pl_load_debug_ext(plApiRegistryI* ptApiRegistry, bool bReload)
pl_set_context(ptDataRegistry->get_data("ui"));

ptStatsApi = ptApiRegistry->first(PL_API_STATS);
gptGpuAllocators = ptApiRegistry->first(PL_API_GPU_ALLOCATORS);
ptIOCtx = pl_get_io();

if(bReload)
Expand All @@ -1085,7 +1088,7 @@ pl_load_debug_ext(plApiRegistryI* ptApiRegistry, bool bReload)
}

PL_EXPORT void
pl_unload_debug_ext(plApiRegistryI* ptApiRegistry)
pl_unload_ext(plApiRegistryI* ptApiRegistry)
{
pl_sb_free(sbppdValues);
pl_sb_free(sbppdFrameValues);
Expand Down
4 changes: 2 additions & 2 deletions extensions/pl_ecs_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ pl_calculate_tangents(plMeshComponent* atMeshes, uint32_t uComponentCount)
//-----------------------------------------------------------------------------

PL_EXPORT void
pl_load_ecs_ext(plApiRegistryI* ptApiRegistry, bool bReload)
pl_load_ext(plApiRegistryI* ptApiRegistry, bool bReload)
{
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
pl_set_memory_context(ptDataRegistry->get_data(PL_CONTEXT_MEMORY));
Expand Down Expand Up @@ -1511,7 +1511,7 @@ pl_load_ecs_ext(plApiRegistryI* ptApiRegistry, bool bReload)
}

PL_EXPORT void
pl_unload_ecs_ext(plApiRegistryI* ptApiRegistry)
pl_unload_ext(plApiRegistryI* ptApiRegistry)
{

}
Loading

0 comments on commit 00d1de9

Please sign in to comment.