adding software computer base

This commit is contained in:
2025-03-02 21:37:17 +01:00
parent 93a69d37e9
commit 9771dcc530
25 changed files with 539 additions and 25 deletions

29
Examples/Software/main.c git.filemode.normal_file
View File

@@ -0,0 +1,29 @@
#include <Pulse.h>
#include <stdio.h>
#include <stdlib.h>
void DebugCallBack(PulseDebugMessageSeverity severity, const char* message)
{
if(severity == PULSE_DEBUG_MESSAGE_SEVERITY_ERROR)
{
fprintf(stderr, "Pulse Error: %s\n", message);
exit(1);
}
else if(severity == PULSE_DEBUG_MESSAGE_SEVERITY_WARNING)
fprintf(stderr, "Pulse Warning: %s\n", message);
else
printf("Pulse: %s\n", message);
}
int main(void)
{
PulseBackend backend = PulseLoadBackend(PULSE_BACKEND_SOFTWARE, PULSE_SHADER_FORMAT_SPIRV_BIT, PULSE_HIGH_DEBUG);
PulseSetDebugCallback(backend, DebugCallBack);
PulseDevice device = PulseCreateDevice(backend, NULL, 0);
PulseDestroyDevice(device);
PulseUnloadBackend(backend);
puts("Successfully executed Pulse example using Software backend !");
return 0;
}

7
Examples/Software/xmake.lua git.filemode.normal_file
View File

@@ -0,0 +1,7 @@
target("SoftwareExample")
add_deps("pulse_gpu")
if is_plat("linux") then
set_extension(".x86_64")
end
add_files("*.c")
target_end()

View File

@@ -8,4 +8,7 @@ if has_config("examples") then
if has_config("webgpu") then
includes("WebGPU/xmake.lua")
end
if has_config("software") then
includes("Software/xmake.lua")
end
end