diff --git a/Examples/Vulkan/shader.nzsl b/Examples/Vulkan/shader.nzsl index 682eec6..fe95e96 100644 --- a/Examples/Vulkan/shader.nzsl +++ b/Examples/Vulkan/shader.nzsl @@ -21,5 +21,5 @@ external [workgroup(16, 16, 1)] fn main(input: Input) { - ssbo.data[input.indices.x * input.indices.y] = i32(input.indices.x * input.indices.y); + ssbo.data[input.indices.x * input.indices.y] = i32(input.indices.x * input.indices.y); } diff --git a/Sources/Backends/Software/SoftCommandList.c b/Sources/Backends/Software/SoftCommandList.c index a1d30e6..a5aea4e 100644 --- a/Sources/Backends/Software/SoftCommandList.c +++ b/Sources/Backends/Software/SoftCommandList.c @@ -53,7 +53,6 @@ static void SoftCommandDispatch(SoftCommand* cmd) thrd_t* invocations = (thrd_t*)malloc(invocations_count * sizeof(thrd_t)); PULSE_CHECK_PTR(invocations); - printf("test2 %d %d\n", invocations_count, local_size); uint32_t invocation_index = 0; for(uint32_t z = 0; z < cmd->Dispatch.groupcount_z; z++) { @@ -63,21 +62,15 @@ static void SoftCommandDispatch(SoftCommand* cmd) { for(uint32_t i = 0; i < local_size; i++) { - printf("\r%d", invocation_index); thrd_create(&invocations[invocation_index], SoftCommandDispatchCore, soft_pipeline); + thrd_join(invocations[invocation_index], NULL); invocation_index++; } } } } - printf("\ntest %d %d %d\n", invocation_index, invocations_count, local_size); for(uint32_t i = 0; i < invocations_count; i++) - { - printf("test %d\n", i); - int res; - thrd_join(invocations[i], &res); - PULSE_UNUSED(res); - } + thrd_join(invocations[i], PULSE_NULLPTR); free(invocations); } diff --git a/Sources/Backends/Software/SoftComputePipeline.c b/Sources/Backends/Software/SoftComputePipeline.c index 6aa6c54..f008022 100644 --- a/Sources/Backends/Software/SoftComputePipeline.c +++ b/Sources/Backends/Software/SoftComputePipeline.c @@ -34,6 +34,10 @@ PulseComputePipeline SoftCreateComputePipeline(PulseDevice device, const PulseCo soft_pipeline->entry_point = calloc(1, strlen(info->entrypoint)); strcpy((char*)soft_pipeline->entry_point, info->entrypoint); + // Create dummy state to retrieve informations from the spirv + spvm_state_t state = spvm_state_create(soft_pipeline->program); + spvm_state_delete(state); + pipeline->driver_data = soft_pipeline; if(PULSE_IS_BACKEND_HIGH_LEVEL_DEBUG(device->backend)) @@ -52,6 +56,7 @@ void SoftDestroyComputePipeline(PulseDevice device, PulseComputePipeline pipelin PULSE_UNUSED(device); SoftComputePipeline* soft_pipeline = SOFT_RETRIEVE_DRIVER_DATA_AS(pipeline, SoftComputePipeline*); spvm_program_delete(soft_pipeline->program); + free(soft_pipeline->entry_point); free(soft_pipeline); if(PULSE_IS_BACKEND_HIGH_LEVEL_DEBUG(device->backend)) PulseLogInfoFmt(device->backend, "(Soft) destroyed compute pipeline %p", pipeline);