Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Dec 13, 2024
1 parent 37f3baf commit e4e3cbf
Show file tree
Hide file tree
Showing 12 changed files with 293 additions and 143 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
if not exist ../out/example_9.dll exit 1
if not exist ../out/pilot_light.exe exit 1
if not exist ../out/pl_unity_ext.dll exit 1
if not exist ../out/pl_script_camerad.dll exit 1
if not exist ../out/pl_script_camera.dll exit 1
cd ..
- name: Prep 2
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
test -f ./out/example_8.dylib || exit 1
test -f ./out/example_9.dylib || exit 1
test -f ./out/pl_unity_ext.dylib || exit 1
test -f ./out/pl_script_camerad.dylib || exit 1
test -f ./out/pl_script_camera.dylib || exit 1
- name: Prep 2
run: |
Expand Down Expand Up @@ -325,7 +325,7 @@ jobs:
test -f ./out/example_8.so || exit 1
test -f ./out/example_9.so || exit 1
test -f ./out/pl_unity_ext.so || exit 1
test -f ./out/pl_script_camerad.so || exit 1
test -f ./out/pl_script_camera.so || exit 1
- name: Prep 2
run: |
Expand Down
3 changes: 1 addition & 2 deletions extensions/pl_draw_backend_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ pl_cleanup_draw_backend(void)
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atBufferInfo[i].tVertexBuffer);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->at3DBufferInfo[i].tVertexBuffer);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atLineBufferInfo[i].tVertexBuffer);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atIndexBuffer[i]);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atIndexBuffer[i]);
gptGfx->destroy_buffer(ptDevice, gptDrawBackendCtx->atIndexBuffer[i]);
}

gptGfx->cleanup_bind_group_pool(gptDrawBackendCtx->ptBindGroupPool);
Expand Down
2 changes: 1 addition & 1 deletion extensions/pl_ecs_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ pl_ecs_remove_entity(plComponentLibrary* ptLibrary, plEntity tEntity)
{
plEntity tLastEntity = pl_sb_back(ptLibrary->_ptManagers[i]->sbtEntities);
pl_hm_remove(ptLibrary->_ptManagers[i]->ptHashmap, tLastEntity.uIndex);
pl_hm_get_free_index(ptLibrary->_ptManagers[i]->ptHashmap); // burn slot
uint32_t _unUsed = pl_hm_get_free_index(ptLibrary->_ptManagers[i]->ptHashmap); // burn slot
pl_hm_insert(ptLibrary->_ptManagers[i]->ptHashmap, tLastEntity.uIndex, uEntityValue);
}

Expand Down
37 changes: 36 additions & 1 deletion extensions/pl_graphics_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ typedef struct _plComputeEncoder plComputeEncoder; // opaque type for command b
typedef struct _plBlitEncoder plBlitEncoder; // opaque type for command buffer encoder for blit ops
typedef struct _plBufferImageCopy plBufferImageCopy;// used for copying between buffers & textures with blit encoder

// new
typedef struct _plPassTextureResource plPassTextureResource;
typedef struct _plPassBufferResource plPassBufferResource;
typedef struct _plPassResources plPassResources;

// bind groups
typedef struct _plBindGroup plBindGroup; // bind group resource
typedef struct _plBindGroupLayout plBindGroupLayout; // bind group layout decription
Expand Down Expand Up @@ -192,6 +197,7 @@ typedef int plVendorId; // -> enum _plVendorId // Enu
typedef int plDeviceType; // -> enum _plDeviceType // Enum: device type (PL_DEVICE_TYPE_XXXX)
typedef int plDeviceCapability; // -> enum _plDeviceCapability // Flags: device capabilities (PL_DEVICE_CAPABILITY_XXXX)
typedef int plCommandPoolResetFlags; // -> enum _plCommandPoolResetFlags // Flags: device capabilities (PL_DEVICE_CAPABILITY_XXXX)
typedef int plPassResourceUsageFlags;

// external
typedef struct _plWindow plWindow; // pl_os.h
Expand Down Expand Up @@ -281,7 +287,7 @@ typedef struct _plGraphicsI
void (*bind_shader) (plRenderEncoder*, plShaderHandle);

// compute encoder
plComputeEncoder* (*begin_compute_pass) (plCommandBuffer*); // do not store
plComputeEncoder* (*begin_compute_pass) (plCommandBuffer*, const plPassResources*); // do not store
void (*end_compute_pass) (plComputeEncoder*);
void (*dispatch) (plComputeEncoder*, uint32_t dispatchCount, const plDispatch*);
void (*bind_compute_shader) (plComputeEncoder*, plComputeShaderHandle);
Expand Down Expand Up @@ -556,6 +562,28 @@ typedef struct _plBindGroupUpdateData
const plBindGroupUpdateSamplerData* atSamplerBindings;
} plBindGroupUpdateData;

typedef struct _plPassTextureResource
{
plTextureHandle tHandle;
plStageFlags tStages;
plPassResourceUsageFlags tUsage;
} plPassTextureResource;

typedef struct _plPassBufferResource
{
plBufferHandle tHandle;
plStageFlags tStages;
plPassResourceUsageFlags tUsage;
} plPassBufferResource;

typedef struct _plPassResources
{
uint32_t uBufferCount;
uint32_t uTextureCount;
const plPassBufferResource* atBuffers;
const plPassTextureResource* atTextures;
} plPassResources;

typedef struct _plBindGroupLayout
{

Expand Down Expand Up @@ -961,6 +989,13 @@ typedef struct _plDeviceInit
// [SECTION] enums
//-----------------------------------------------------------------------------

enum _plPassResourceUsageFlags
{
PL_PASS_RESOURCE_USAGE_NONE = 0,
PL_PASS_RESOURCE_USAGE_READ = 1 << 0,
PL_PASS_RESOURCE_USAGE_WRITE = 1 << 1,
};

enum _plBindGroupPoolFlags
{
PL_BIND_GROUP_POOL_FLAGS_NONE = 0,
Expand Down
Loading

0 comments on commit e4e3cbf

Please sign in to comment.