Skip to content

Commit 625283f

Browse files
committed
WIP 0
1 parent 131c897 commit 625283f

71 files changed

Lines changed: 6032 additions & 7614 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Install Dependencies
3636
run: |
37-
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.3.296.0/windows/VulkanSDK-1.3.296.0-Installer.exe" -OutFile VulkanSDK.exe
37+
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.4.350.0/windows/vulkansdk-windows-X64-1.4.350.0.exe" -OutFile VulkanSDK.exe
3838
# ./VulkanSDK.exe --help
3939
./VulkanSDK.exe --accept-licenses --default-answer --root D:/a/VulkanSDK --confirm-command install
4040
@@ -136,9 +136,9 @@ jobs:
136136

137137
- name: Install Dependencies
138138
run: |
139-
curl https://sdk.lunarg.com/sdk/download/1.3.283.0/mac/vulkansdk-macos-1.3.283.0.dmg -o vk.dmg
140-
hdiutil attach vk.dmg
141-
sudo /Volumes/vulkansdk-macos-1.3.283.0/InstallVulkan.app/Contents/MacOS/InstallVulkan --root ~/VulkanSDK/1.3.283.0 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.usr com.lunarg.vulkan.sdl2 com.lunarg.vulkan.glm com.lunarg.vulkan.volk com.lunarg.vulkan.vma com.lunarg.vulkan.ios
139+
curl https://sdk.lunarg.com/sdk/download/1.4.350.0/mac/vulkansdk-macos-1.4.350.0.zip -o vk.zip
140+
unzip vk.zip
141+
sudo ./vulkansdk-macOS-1.4.350.0.app/Contents/MacOS/vulkansdk-macOS-1.4.350.0 --root ~/VulkanSDK/1.4.350.0 --accept-licenses --default-answer --confirm-command install com.lunarg.vulkan.core com.lunarg.vulkan.usr com.lunarg.vulkan.sdl2 com.lunarg.vulkan.glm com.lunarg.vulkan.volk com.lunarg.vulkan.vma com.lunarg.vulkan.ios
142142
143143
- name: Prep 1
144144
run: |

docs/changelog.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
Below is the change log for typical users. Minor and older changes stripped
66
away, please see git history for details.
77

8-
- v0.9.3 (2026-06-02)(graphics v1.10.0) -last version before 2.x with breaking changes
8+
- v0.10.0 (xx-xx-xx)
9+
- v0.9.3 (2026-06-02)(graphics v1.10.0) -last version before 2.x with breaking changes
910
-remove necessity of subpass dependencies
1011
-remove necessity of "set_texture_usage(...)"
1112
(camera v1.0.1) -fix camera zero init issues

docs/version.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
v0.9.3
1+
v0.10.0 WIP
22

33
-----------------------------------------------------------------------------
44
Versioning
@@ -56,32 +56,32 @@ the API is complete. It just means we won't break what currently exists.
5656
* Log v2.0.0 (pl_log_ext.h)
5757
* Config v1.2.0 (pl_config_ext.h)
5858
* Console v1.1.0 (pl_console_ext.h)
59-
* Draw v2.1.1 (pl_draw_ext.h)
60-
* DXT v1.1.0 (pl_dxt_ext.h)
59+
* Draw v3.0.0 (pl_draw_ext.h)
60+
* DXT v2.0.0 (pl_dxt_ext.h)
6161
* GPU Allocators v1.1.1 (pl_gpu_allocators_ext.h)
62-
* Graphics v1.10.0 (pl_graphics_ext.h)
62+
* Graphics v2.0.0 (pl_graphics_ext.h)
6363
* Image v1.2.0 (pl_image_ext.h)
6464
* Job v2.3.0 (pl_job_ext.h)
6565
* Atomics v2.0.0 (pl_platform_ext.h)
66-
* File v1.1.0 (pl_platform_ext.h)
66+
* File v2.0.0 (pl_platform_ext.h)
6767
* Network v1.0.0 (pl_platform_ext.h)
6868
* Threads v1.0.1 (pl_platform_ext.h)
6969
* Virtual Memory v1.0.0 (pl_platform_ext.h)
7070
* Profile v2.0.0 (pl_profile_ext.h)
7171
* Rectangle Packing v1.1.0 (pl_rect_pack_ext.h)
7272
* Screen Log v2.2.0 (pl_screen_log_ext.h)
73-
* Shader v1.4.0 (pl_shader_ext.h)
74-
* Starter v1.4.1 (pl_starter_ext.h)
73+
* Shader v2.0.0 (pl_shader_ext.h)
74+
* Starter v2.0.0 (pl_starter_ext.h)
7575
* Stats v1.1.0 (pl_stats_ext.h)
7676
* String Interning v2.0.0 (pl_string_intern_ext.h)
7777
* UI Tools v1.1.0 (pl_tools_ext.h)
7878
* UI v1.2.0 (pl_ui_ext.h)
7979
* Pak Files v1.2.0 (pl_pak_ext.h)
80-
* Date & Time v1.1.0 (pl_datetime_ext.h)
80+
* Date & Time v2.0.0 (pl_datetime_ext.h)
8181
* Compression v1.1.0 (pl_compress_ext.h)
8282
* Virtual File System v2.1.0 (pl_vfs_ext.h)
83-
* ECS v1.1.0 (pl_ecs_ext.h)
84-
* DDS v1.1.0 (pl_dds_ext.h)
83+
* ECS v2.0.0 (pl_ecs_ext.h)
84+
* DDS v2.0.0 (pl_dds_ext.h)
8585
* Resource v1.5.0 (pl_resource_ext.h)
8686
* Camera v1.0.2 (pl_camera_ext.h)
8787

@@ -100,13 +100,13 @@ the API is complete. It just means we won't break what currently exists.
100100
* Camera ECS v0.1.0 (pl_camera_ext.h)
101101
* Gizmo v0.1.0 (pl_gizmo_ext.h)
102102
* Model Loader v0.3.0 (pl_model_loader_ext.h)
103-
* Dear ImGui v0.1.0 (pl_dear_imgui_ext.h)
103+
* Dear ImGui v0.2.0 (pl_dear_imgui_ext.h)
104104
* Animation v0.1.0 (pl_animation_ext.h)
105105
* Material v0.1.0 (pl_material_ext.h)
106106
* Terrain v0.1.0 (pl_terrain_ext.h)
107107
* Free List v0.1.0 (pl_freelist_ext.h)
108108
* Image Ops v0.1.0 (pl_image_ops_ext.h)
109-
* Stage v0.1.0 (pl_stage_ext.h)
109+
* Stage v0.2.0 (pl_stage_ext.h)
110110
* Renderer v0.3.0 (pl_renderer_ext.h)
111111
* Renderer Terrain v0.1.0 (pl_renderer_ext.h)
112112
* Renderer Ecs v0.1.0 (pl_renderer_ext.h)

examples/example_basic_2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
141141

142142
// initialize the starter API (handles alot of boilerplate)
143143
plStarterInit tStarterInit = {
144-
.tFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
144+
.eFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
145145
.ptWindow = ptAppData->ptWindow
146146
};
147147
pl_starter_initialize(tStarterInit);

examples/example_basic_3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
197197

198198
// initialize the starter API (handles alot of boilerplate)
199199
plStarterInit tStarterInit = {
200-
.tFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
200+
.eFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
201201
.ptWindow = ptAppData->ptWindow
202202
};
203203
gptStarter->initialize(tStarterInit);

examples/example_basic_4.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
136136

137137
// initialize the starter API
138138
plStarterInit tStarterInit = {
139-
.tFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
139+
.eFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
140140
.ptWindow = ptAppData->ptWindow
141141
};
142142

143143
// we will remove this flag so we can handle
144144
// management of the UI extension
145-
tStarterInit.tFlags &= ~PL_STARTER_FLAGS_DRAW_EXT;
145+
tStarterInit.eFlags &= ~PL_STARTER_FLAGS_DRAW_EXT;
146146

147147
gptStarter->initialize(tStarterInit);
148148

@@ -384,11 +384,13 @@ pl_app_update(plAppData* ptAppData)
384384
// the scope of the draw extension.
385385

386386
// start main pass & return the encoder being used
387-
plRenderEncoder* ptEncoder = gptStarter->begin_main_pass();
387+
plCommandBuffer* ptCmdBuffer = gptStarter->begin_main_pass();
388388

389389
// submit our drawlist
390390
plIO* ptIO = gptIO->get_io();
391-
gptDraw->submit_2d_drawlist(ptAppData->ptDrawlist, ptEncoder, ptIO->tMainViewportSize.x, ptIO->tMainViewportSize.y, 1);
391+
plRenderAttachmentInfo tRenderAttachmentInfo = {0};
392+
gptStarter->get_render_attachment_info(&tRenderAttachmentInfo);
393+
gptDraw->submit_2d_drawlist(ptAppData->ptDrawlist, ptCmdBuffer, ptIO->tMainViewportSize.x, ptIO->tMainViewportSize.y, 1, &tRenderAttachmentInfo);
392394

393395
// allows the starter extension to handle some things then ends the main pass
394396
gptStarter->end_main_pass();

examples/example_basic_5.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Index of this file:
4545
#include "pl_ui_ext.h"
4646
#include "pl_draw_ext.h"
4747
#include "pl_starter_ext.h"
48+
#include "pl_graphics_ext.h"
4849

4950
//-----------------------------------------------------------------------------
5051
// [SECTION] structs
@@ -127,13 +128,13 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
127128
gptWindows->show(ptAppData->ptWindow);
128129

129130
plStarterInit tStarterInit = {
130-
.tFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
131+
.eFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
131132
.ptWindow = ptAppData->ptWindow
132133
};
133134

134135
// we will remove this flag so we can handle
135136
// management of the UI extension
136-
tStarterInit.tFlags &= ~PL_STARTER_FLAGS_UI_EXT;
137+
tStarterInit.eFlags &= ~PL_STARTER_FLAGS_UI_EXT;
137138

138139
gptStarter->initialize(tStarterInit);
139140

@@ -220,7 +221,7 @@ pl_app_update(plAppData* ptAppData)
220221
// the scope of the draw extension.
221222

222223
// start main pass & return the encoder being used
223-
plRenderEncoder* ptEncoder = gptStarter->begin_main_pass();
224+
plCommandBuffer* ptCmdBuffer = gptStarter->begin_main_pass();
224225

225226
// this must be called which handles several things but
226227
// most importantly it orders the various draw layers in
@@ -230,8 +231,10 @@ pl_app_update(plAppData* ptAppData)
230231
// now we must submit both the drawlist & debug drawlist provided by
231232
// the UI extension.
232233
plVec2 tViewportSize = gptIO->get_io()->tMainViewportSize;
233-
gptDraw->submit_2d_drawlist(gptUi->get_draw_list(), ptEncoder, tViewportSize.x, tViewportSize.y, 1);
234-
gptDraw->submit_2d_drawlist(gptUi->get_debug_draw_list(), ptEncoder, tViewportSize.x, tViewportSize.y, 1);
234+
plRenderAttachmentInfo tRenderAttachmentInfo = {0};
235+
gptStarter->get_render_attachment_info(&tRenderAttachmentInfo);
236+
gptDraw->submit_2d_drawlist(gptUi->get_draw_list(), ptCmdBuffer, tViewportSize.x, tViewportSize.y, 1, &tRenderAttachmentInfo);
237+
gptDraw->submit_2d_drawlist(gptUi->get_debug_draw_list(), ptCmdBuffer, tViewportSize.x, tViewportSize.y, 1, &tRenderAttachmentInfo);
235238

236239
// allows the starter extension to handle some things then ends the main pass
237240
gptStarter->end_main_pass();

examples/example_basic_6.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
187187
gptStarter->finalize();
188188

189189
// initializes out Dear ImGui backend
190-
gptDearImGui->initialize(gptStarter->get_device(), gptStarter->get_swapchain(), gptStarter->get_render_pass());
190+
plRenderAttachmentInfo tRenderAttachmentInfo = {};
191+
gptStarter->get_render_attachment_info(&tRenderAttachmentInfo);
192+
gptDearImGui->initialize(gptStarter->get_device(), gptStarter->get_swapchain(), &tRenderAttachmentInfo);
191193

192194
// same process for implot as imgui
193195
ImPlot::SetCurrentContext((ImPlotContext*)ptDataRegistry->get_data("implot"));
@@ -233,7 +235,7 @@ pl_app_update(plAppData* ptAppData)
233235
if(!gptStarter->begin_frame())
234236
return;
235237

236-
gptDearImGui->new_frame(gptStarter->get_device(), gptStarter->get_render_pass());
238+
gptDearImGui->new_frame(gptStarter->get_device());
237239

238240
ImGui::DockSpaceOverViewport();
239241

@@ -253,10 +255,10 @@ pl_app_update(plAppData* ptAppData)
253255

254256

255257
// start main pass & return the encoder being used
256-
plRenderEncoder* ptEncoder = gptStarter->begin_main_pass();
258+
plCommandBuffer* ptCommandBuffer = gptStarter->begin_main_pass();
257259

258260
// submit Dear ImGui stuff
259-
gptDearImGui->render(ptEncoder, gptGfx->get_encoder_command_buffer(ptEncoder));
261+
gptDearImGui->render(ptCommandBuffer);
260262

261263
// allows the starter extension to handle some things then ends the main pass
262264
gptStarter->end_main_pass();

examples/example_gfx_0.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
173173
gptWindows->show(ptAppData->ptWindow);
174174

175175
plStarterInit tStarterInit = {
176-
.tFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
176+
.eFlags = PL_STARTER_FLAGS_ALL_EXTENSIONS,
177177
.ptWindow = ptAppData->ptWindow
178178
};
179179

180180
// we will remove this flag so we can handle
181181
// management of the shader extension
182-
tStarterInit.tFlags &= ~PL_STARTER_FLAGS_SHADER_EXT;
182+
tStarterInit.eFlags &= ~PL_STARTER_FLAGS_SHADER_EXT;
183183

184184
// from a graphics standpoint, the starter extension is handling device, swapchain, renderpass
185185
// etc. which we will get to in later examples
@@ -194,7 +194,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
194194
"../shaders/",
195195
"../examples/shaders/"
196196
},
197-
.tFlags = PL_SHADER_FLAGS_AUTO_OUTPUT | PL_SHADER_FLAGS_NEVER_CACHE
197+
.eFlags = PL_SHADER_FLAGS_AUTO_OUTPUT | PL_SHADER_FLAGS_NEVER_CACHE
198198
};
199199
gptShader->initialize(&tDefaultShaderOptions);
200200

@@ -216,7 +216,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
216216

217217
// create vertex buffer
218218
const plBufferDesc tBufferDesc = {
219-
.tUsage = PL_BUFFER_USAGE_VERTEX | PL_BUFFER_USAGE_TRANSFER_DESTINATION,
219+
.eUsage = PL_BUFFER_USAGE_VERTEX | PL_BUFFER_USAGE_TRANSFER,
220220
.szByteSize = sizeof(float) * PL_ARRAYSIZE(atVertexData),
221221
.pcDebugName = "vertex buffer"
222222
};
@@ -244,26 +244,26 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
244244

245245
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~shaders~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246246

247-
const plShaderDesc tShaderDesc = {
247+
plShaderDesc tShaderDesc = {
248248
.tVertexShader = gptShader->load_glsl("example_gfx_0.vert", "main", NULL, NULL),
249249
.tFragmentShader = gptShader->load_glsl("example_gfx_0.frag", "main", NULL, NULL),
250250
.tGraphicsState = {
251-
.ulDepthWriteEnabled = 0,
252-
.ulDepthMode = PL_COMPARE_MODE_ALWAYS,
253-
.ulCullMode = PL_CULL_MODE_NONE,
254-
.ulWireframe = 0,
255-
.ulStencilMode = PL_COMPARE_MODE_ALWAYS,
256-
.ulStencilRef = 0xff,
257-
.ulStencilMask = 0xff,
258-
.ulStencilOpFail = PL_STENCIL_OP_KEEP,
259-
.ulStencilOpDepthFail = PL_STENCIL_OP_KEEP,
260-
.ulStencilOpPass = PL_STENCIL_OP_KEEP
251+
.bDepthWriteEnabled = 0,
252+
.eDepthMode = PL_COMPARE_MODE_ALWAYS,
253+
.eCullMode = PL_CULL_MODE_NONE,
254+
.bWireframe = 0,
255+
.eStencilMode = PL_COMPARE_MODE_ALWAYS,
256+
.uStencilRef = 0xff,
257+
.uStencilMask = 0xff,
258+
.eStencilOpFail = PL_STENCIL_OP_KEEP,
259+
.eStencilOpDepthFail = PL_STENCIL_OP_KEEP,
260+
.eStencilOpPass = PL_STENCIL_OP_KEEP
261261
},
262262
.atVertexBufferLayouts = {
263263
{
264264
.atAttributes = {
265-
{.tFormat = PL_VERTEX_FORMAT_FLOAT2 },
266-
{.tFormat = PL_VERTEX_FORMAT_FLOAT4 },
265+
{.eFormat = PL_VERTEX_FORMAT_FLOAT2 },
266+
{.eFormat = PL_VERTEX_FORMAT_FLOAT4 },
267267
}
268268
}
269269
},
@@ -272,9 +272,9 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
272272
.bBlendEnabled = false,
273273
.uColorWriteMask = PL_COLOR_WRITE_MASK_ALL
274274
}
275-
},
276-
.tRenderPassLayout = gptStarter->get_render_pass_layout(),
275+
}
277276
};
277+
gptStarter->get_render_attachment_info(&tShaderDesc.tRenderAttachmentInfo);
278278
ptAppData->tShader = gptGfx->create_shader(ptDevice, &tShaderDesc);
279279

280280
// return app memory
@@ -323,17 +323,17 @@ pl_app_update(plAppData* ptAppData)
323323
return;
324324

325325
// start main pass & return the encoder being used
326-
plRenderEncoder* ptEncoder = gptStarter->begin_main_pass();
326+
plCommandBuffer* ptCmdBuffer = gptStarter->begin_main_pass();
327327

328328
// submit nonindexed draw using basic API
329-
gptGfx->bind_shader(ptEncoder, ptAppData->tShader);
330-
gptGfx->bind_vertex_buffer(ptEncoder, ptAppData->tVertexBuffer);
329+
gptGfx->bind_shader(ptCmdBuffer, ptAppData->tShader);
330+
gptGfx->bind_vertex_buffer(ptCmdBuffer, ptAppData->tVertexBuffer);
331331

332332
plDraw tDraw = {
333333
.uInstanceCount = 1,
334334
.uVertexCount = 3
335335
};
336-
gptGfx->draw(ptEncoder, 1, &tDraw);
336+
gptGfx->draw(ptCmdBuffer, 1, &tDraw);
337337

338338
// allows the starter extension to handle some things then ends the main pass
339339
gptStarter->end_main_pass();

0 commit comments

Comments
 (0)