mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
working on vulkan
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user