mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
working on software backend
This commit is contained in:
95
Sources/Backends/Software/SoftCommandList.h
git.filemode.normal_file
95
Sources/Backends/Software/SoftCommandList.h
git.filemode.normal_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
|
||||
Reference in New Issue
Block a user