mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
33 lines
1.0 KiB
C
33 lines
1.0 KiB
C
// Copyright (C) 2025 kanel
|
|
// This file is part of "Pulse"
|
|
// For conditions of distribution and use, see copyright notice in LICENSE
|
|
|
|
#ifdef PULSE_ENABLE_WEBGPU_BACKEND
|
|
|
|
#ifndef PULSE_WEBGPU_BUFFER_H_
|
|
#define PULSE_WEBGPU_BUFFER_H_
|
|
|
|
#include <webgpu/webgpu.h>
|
|
|
|
#include <Pulse.h>
|
|
|
|
typedef struct WebGPUBuffer
|
|
{
|
|
WGPUBuffer buffer;
|
|
void* map;
|
|
PulseMapMode current_map_mode;
|
|
PulseBuffer upload_staging;
|
|
bool needs_staging_upload;
|
|
} WebGPUBuffer;
|
|
|
|
PulseBuffer WebGPUCreateBuffer(PulseDevice device, const PulseBufferCreateInfo* create_infos);
|
|
bool WebGPUMapBuffer(PulseBuffer buffer, PulseMapMode mode, void** data);
|
|
void WebGPUUnmapBuffer(PulseBuffer buffer);
|
|
bool WebGPUCopyBufferToBuffer(PulseCommandList cmd, const PulseBufferRegion* src, const PulseBufferRegion* dst);
|
|
bool WebGPUCopyBufferToImage(PulseCommandList cmd, const PulseBufferRegion* src, const PulseImageRegion* dst);
|
|
void WebGPUDestroyBuffer(PulseDevice device, PulseBuffer buffer);
|
|
|
|
#endif // PULSE_WEBGPU_BUFFER_H_
|
|
|
|
#endif // PULSE_ENABLE_WEBGPU_BACKEND
|