Skip to content

Commit d87479e

Browse files
committed
refac: rework shader variant system
1 parent 3e668f4 commit d87479e

17 files changed

+2655
-1901
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ jobs:
185185
if not exist ../out/pl_platform_ext.dll exit 1
186186
if not exist ../out/pilot_light.exe exit 1
187187
if not exist ../out/pl_script_camera.dll exit 1
188-
if not exist ../out/pl_shader_tools_ext.dll exit 1
188+
if not exist ../out/pl_shader_variant_ext.dll exit 1
189189
if not exist ../out/pl_dds_ext.dll exit 1
190190
cd ..
191191
@@ -389,7 +389,7 @@ jobs:
389389
test -f ./out/pl_config_ext.dylib || exit 1
390390
test -f ./out/pl_platform_ext.dylib || exit 1
391391
test -f ./out/pl_script_camera.dylib || exit 1
392-
test -f ./out/pl_shader_tools_ext.dylib || exit 1
392+
test -f ./out/pl_shader_variant_ext.dylib || exit 1
393393
test -f ./out/pl_dds_ext.dylib || exit 1
394394
395395
- name: Package Pilot Light
@@ -604,7 +604,7 @@ jobs:
604604
test -f ./out/pl_config_ext.so || exit 1
605605
test -f ./out/pl_platform_ext.so || exit 1
606606
test -f ./out/pl_script_camera.so || exit 1
607-
test -f ./out/pl_shader_tools_ext.so || exit 1
607+
test -f ./out/pl_shader_variant_ext.so || exit 1
608608
test -f ./out/pl_dds_ext.so || exit 1
609609
610610
- name: Package Pilot Light

docs/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ the API is complete. It just means we won't break what currently exists.
9090
* Collision v0.2.0 (pl_collision_ext.h)
9191
* Mesh v0.1.0 (pl_mesh_ext.h)
9292
* Mesh Builder v0.1.0 (pl_mesh_ext.h)
93-
* Shader Tools v0.2.0 (pl_shader_tools_ext.h)
93+
* Shader Variant v0.2.0 (pl_shader_variant_ext.h)
9494
* DDS v0.2.0 (pl_dds_ext.h)
9595

9696
## Unstable Extensions

editor/app.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Index of this file:
7373
#include "pl_physics_ext.h"
7474
#include "pl_collision_ext.h"
7575
#include "pl_bvh_ext.h"
76-
#include "pl_shader_tools_ext.h"
76+
#include "pl_shader_variant_ext.h"
7777
#include "pl_vfs_ext.h"
7878
#include "pl_compress_ext.h"
7979

@@ -112,7 +112,7 @@ const plResourceI* gptResource = NULL;
112112
const plStarterI* gptStarter = NULL;
113113
const plAnimationI* gptAnimation = NULL;
114114
const plMeshI* gptMesh = NULL;
115-
const plShaderToolsI* gptShaderTools = NULL;
115+
const plShaderVariantI* gptShaderVariant = NULL;
116116
const plVfsI* gptVfs = NULL;
117117
const plPakI* gptPak = NULL;
118118
const plDateTimeI* gptDateTime = NULL;
@@ -312,10 +312,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
312312
// initialize job system
313313
gptJobs->initialize((plJobSystemInit){0});
314314

315-
const plShaderToolsInit tShaderVariantInit = {
315+
const plShaderVariantInit tShaderVariantInit = {
316316
.ptDevice = ptAppData->ptDevice
317317
};
318-
gptShaderTools->initialize(tShaderVariantInit);
318+
gptShaderVariant->initialize(tShaderVariantInit);
319319

320320
// setup reference renderer
321321
plRendererSettings tRenderSettings = {
@@ -517,7 +517,7 @@ pl_app_shutdown(plAppData* ptAppData)
517517

518518
gptEcs->cleanup();
519519
gptRenderer->cleanup();
520-
gptShaderTools->cleanup();
520+
gptShaderVariant->cleanup();
521521
gptStarter->cleanup();
522522
gptWindows->destroy(ptAppData->ptWindow);
523523

@@ -566,7 +566,7 @@ pl_app_update(plAppData* ptAppData)
566566
}
567567

568568
// update statistics
569-
gptShaderTools->update_stats();
569+
gptShaderVariant->update_stats();
570570

571571
plCamera* ptCamera = (plCamera*)gptEcs->get_component(ptAppData->ptComponentLibrary, gptCamera->get_ecs_type_key(), ptAppData->tMainCamera);
572572

@@ -925,7 +925,7 @@ pl__load_apis(plApiRegistryI* ptApiRegistry)
925925
gptStarter = pl_get_api_latest(ptApiRegistry, plStarterI);
926926
gptAnimation = pl_get_api_latest(ptApiRegistry, plAnimationI);
927927
gptMesh = pl_get_api_latest(ptApiRegistry, plMeshI);
928-
gptShaderTools = pl_get_api_latest(ptApiRegistry, plShaderToolsI);
928+
gptShaderVariant = pl_get_api_latest(ptApiRegistry, plShaderVariantI);
929929
gptVfs = pl_get_api_latest(ptApiRegistry, plVfsI);
930930
gptPak = pl_get_api_latest(ptApiRegistry, plPakI);
931931
gptDateTime = pl_get_api_latest(ptApiRegistry, plDateTimeI);

editor/editor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
8484
gptStarter = pl_get_api_latest(ptApiRegistry, plStarterI);
8585
gptAnimation = pl_get_api_latest(ptApiRegistry, plAnimationI);
8686
gptMesh = pl_get_api_latest(ptApiRegistry, plMeshI);
87-
gptShaderTools = pl_get_api_latest(ptApiRegistry, plShaderToolsI);
87+
gptShaderVariant = pl_get_api_latest(ptApiRegistry, plShaderVariantI);
8888
gptVfs = pl_get_api_latest(ptApiRegistry, plVfsI);
8989
gptPak = pl_get_api_latest(ptApiRegistry, plPakI);
9090
gptDateTime = pl_get_api_latest(ptApiRegistry, plDateTimeI);
@@ -140,7 +140,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
140140
gptStarter = pl_get_api_latest(ptApiRegistry, plStarterI);
141141
gptAnimation = pl_get_api_latest(ptApiRegistry, plAnimationI);
142142
gptMesh = pl_get_api_latest(ptApiRegistry, plMeshI);
143-
gptShaderTools = pl_get_api_latest(ptApiRegistry, plShaderToolsI);
143+
gptShaderVariant = pl_get_api_latest(ptApiRegistry, plShaderVariantI);
144144
gptVfs = pl_get_api_latest(ptApiRegistry, plVfsI);
145145
gptPak = pl_get_api_latest(ptApiRegistry, plPakI);
146146
gptDateTime = pl_get_api_latest(ptApiRegistry, plDateTimeI);
@@ -227,10 +227,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
227227
// initialize job system
228228
gptJobs->initialize({});
229229

230-
const plShaderToolsInit tShaderVariantInit = {
230+
const plShaderVariantInit tShaderVariantInit = {
231231
ptAppData->ptDevice
232232
};
233-
gptShaderTools->initialize(tShaderVariantInit);
233+
gptShaderVariant->initialize(tShaderVariantInit);
234234

235235
// setup reference renderer
236236
plRendererSettings tRenderSettings = PL_ZERO_INIT;
@@ -354,7 +354,7 @@ pl_app_shutdown(plAppData* ptAppData)
354354
gptRenderer->cleanup_scene(ptAppData->ptScene);
355355
gptEcs->cleanup();
356356
gptRenderer->cleanup();
357-
gptShaderTools->cleanup();
357+
gptShaderVariant->cleanup();
358358
gptStarter->cleanup();
359359
gptWindows->destroy(ptAppData->ptWindow);
360360
pl_sb_free(ptAppData->sbtTestModels);
@@ -403,7 +403,7 @@ pl_app_update(plAppData* ptAppData)
403403
}
404404

405405
// update statistics
406-
gptShaderTools->update_stats();
406+
gptShaderVariant->update_stats();
407407

408408
if(ptAppData->ptScene)
409409
{

editor/editor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Index of this file:
7171
#include "pl_physics_ext.h"
7272
#include "pl_collision_ext.h"
7373
#include "pl_bvh_ext.h"
74-
#include "pl_shader_tools_ext.h"
74+
#include "pl_shader_variant_ext.h"
7575

7676
// dear imgui
7777
#include "pl_dear_imgui_ext.h"
@@ -114,7 +114,7 @@ const plResourceI* gptResource = nullptr;
114114
const plStarterI* gptStarter = nullptr;
115115
const plAnimationI* gptAnimation = nullptr;
116116
const plMeshI* gptMesh = nullptr;
117-
const plShaderToolsI* gptShaderTools = nullptr;
117+
const plShaderVariantI* gptShaderVariant = nullptr;
118118
const plVfsI* gptVfs = nullptr;
119119
const plPakI* gptPak = nullptr;
120120
const plDateTimeI* gptDateTime = nullptr;

0 commit comments

Comments
 (0)