This commit is contained in:
2025-02-26 17:48:24 +01:00
parent bb7b6e716a
commit 39794a27d9
3 changed files with 16 additions and 2 deletions

View File

@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <string.h>
#define WGSL_SOURCE(...) #__VA_ARGS__
#define CHECK_PULSE_HANDLE_RETVAL(handle, retval) \
if(handle == PULSE_NULL_HANDLE) \
{ \
@@ -24,8 +25,6 @@ void DebugCallBack(PulseDebugMessageSeverity severity, const char* message)
printf("Pulse: %s\n", message);
}
#define WGSL_SOURCE(...) #__VA_ARGS__
const char* wgsl_source = WGSL_SOURCE(
@compute @workgroup_size(32, 32, 1)
fn main(@builtin(global_invocation_id) grid: vec3u)
@@ -50,6 +49,17 @@ int main(void)
PulseComputePipeline pipeline = PulseCreateComputePipeline(device, &info);
CHECK_PULSE_HANDLE_RETVAL(pipeline, 1);
PulseCommandList cmd = PulseRequestCommandList(device, PULSE_COMMAND_LIST_GENERAL);
CHECK_PULSE_HANDLE_RETVAL(cmd, 1);
PulseComputePass pass = PulseBeginComputePass(cmd);
CHECK_PULSE_HANDLE_RETVAL(pass, 1);
PulseBindComputePipeline(pass, pipeline);
PulseDispatchComputations(pass, 32, 32, 1);
PulseEndComputePass(pass);
PulseReleaseCommandList(device, cmd);
PulseDestroyComputePipeline(device, pipeline);
PulseDestroyDevice(device);