working on software backend

This commit is contained in:
2025-03-04 00:13:32 +01:00
parent 8c7b2bb44f
commit 211700b955
19 changed files with 539 additions and 32 deletions

95
Sources/Backends/Software/SoftCommandList.h git.filemode.normal_file
View File

@@ -0,0 +1,95 @@
// Copyright (C) 2025 kanel
// This file is part of "Pulse"
// For conditions of distribution and use, see copyright notice in LICENSE
#include <Pulse.h>
#ifdef PULSE_ENABLE_SOFTWARE_BACKEND
#ifndef PULSE_SOFTWARE_COMMAND_LIST_H_
#define PULSE_SOFTWARE_COMMAND_LIST_H_
#include <tinycthread.h>
#include "Soft.h"
#include "SoftEnums.h"
#include "SoftFence.h"
typedef struct SoftCommand
{
SoftCommandType type;
union
{
struct
{
PulseComputePipeline pipeline;
} BindComputePipeline;
struct
{
} BindStorageBuffers;
struct
{
} BindStorageImages;
struct
{
} BindUniformBuffers;
struct
{
const PulseImageRegion* src;
const PulseImageRegion* dst;
} BlitImages;
struct
{
const PulseBufferRegion* src;
const PulseBufferRegion* dst;
} CopyBufferToBuffer;
struct
{
const PulseBufferRegion* src;
const PulseImageRegion* dst;
} CopyBufferToImage;
struct
{
const PulseImageRegion* src;
const PulseBufferRegion* dst;
} CopyImageToBuffer;
struct
{
uint32_t groupcount_x;
uint32_t groupcount_y;
uint32_t groupcount_z;
} Dispatch;
struct
{
PulseBuffer buffer;
uint32_t offset;
} DispatchIndirect;
};
} SoftCommand;
typedef struct SoftCommandList
{
thrd_t thread;
PulseFence fence;
SoftCommand* commands;
uint32_t commands_count;
uint32_t commands_capacity;
} SoftCommandList;
PulseCommandList SoftRequestCommandList(PulseDevice device, PulseCommandListUsage usage);
void SoftQueueCommand(PulseCommandList cmd, SoftCommand command);
bool SoftSubmitCommandList(PulseDevice device, PulseCommandList cmd, PulseFence fence);
void SoftReleaseCommandList(PulseDevice device, PulseCommandList cmd);
#endif // PULSE_SOFTWARE_COMMAND_LIST_H_
#endif // PULSE_ENABLE_SOFTWARE_BACKEND