working on vulkan

This commit is contained in:
2024-10-08 15:23:20 +02:00
parent 81dd86a905
commit b075f8ea73
15 changed files with 174 additions and 66 deletions

View File

@@ -2,6 +2,8 @@
// This file is part of "Pulse"
// For conditions of distribution and use, see copyright notice in LICENSE
#include <stdlib.h>
#include <Pulse.h>
#include "../../PulseInternal.h"
@@ -18,13 +20,33 @@ bool VulkanLoadBackend()
{
if(!VulkanInitLoader())
return false;
return true;
}
PulseDevice VulkanCreatePulseDevice(PulseDebugLevel debug_level)
{
VulkanPulseDevice* vulkan_device = (VulkanPulseDevice*)calloc(1, sizeof(VulkanPulseDevice));
PULSE_CHECK_ALLOCATION_RETVAL(vulkan_device, PULSE_NULL_HANDLE);
if(!VulkanInitInstance(&vulkan_device->instance, debug_level))
return PULSE_NULL_HANDLE;
PulseDeviceHandler* pulse_device = (PulseDeviceHandler*)calloc(1, sizeof(PulseDeviceHandler));
PULSE_CHECK_ALLOCATION_RETVAL(pulse_device, PULSE_NULL_HANDLE);
pulse_device->debug_level = debug_level;
pulse_device->driver_data = vulkan_device;
return pulse_device;
}
void VulkanDestroyPulseDevice(PulseDevice device)
{
}
PulseBackendLoader VulkanDriver = {
.PFN_LoadBackend = VulkanLoadBackend,
.PFN_CreateDevice = PULSE_NULLPTR,
.PFN_CreateDevice = VulkanCreatePulseDevice,
.PFN_DestroyDevice = VulkanDestroyPulseDevice,
.backend = PULSE_BACKEND_VULKAN,
.supported_shader_formats = PULSE_SHADER_FORMAT_SPIRV_BIT
};