moving compute pass to his own files

This commit is contained in:
2025-01-26 14:21:52 +01:00
parent 95173cabb4
commit 4bbbf4e5dd
13 changed files with 219 additions and 166 deletions

View File

@@ -75,42 +75,3 @@ PULSE_API void PulseReleaseCommandList(PulseDevice device, PulseCommandList cmd)
}
return device->PFN_ReleaseCommandList(device, cmd);
}
PULSE_API PulseComputePass PulseBeginComputePass(PulseCommandList cmd)
{
PULSE_CHECK_HANDLE_RETVAL(cmd, PULSE_NULL_HANDLE);
PULSE_CHECK_HANDLE_RETVAL(cmd->device, PULSE_NULL_HANDLE);
PULSE_CHECK_COMMAND_LIST_STATE_RETVAL(cmd, PULSE_NULL_HANDLE);
PulseComputePass pass = cmd->device->PFN_BeginComputePass(cmd);
if(pass->is_recording == true)
{
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(cmd->device->backend))
PulseLogWarning(cmd->device->backend, "a compute pass is already recording in this command buffer, please call PulseEndComputePass before beginning a new one");
return PULSE_NULL_HANDLE;
}
pass->is_recording = true;
return pass;
}
PULSE_API void PulseEndComputePass(PulseComputePass pass)
{
if(pass == PULSE_NULL_HANDLE)
{
PULSE_CHECK_HANDLE(pass->cmd);
PULSE_CHECK_HANDLE(pass->cmd->device);
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(pass->cmd->device->backend))
PulseLogWarning(pass->cmd->device->backend, "command list is NULL, this may be a bug in your application");
return;
}
PULSE_CHECK_COMMAND_LIST_STATE(pass->cmd);
memset(pass->readonly_images, 0, PULSE_MAX_READ_TEXTURES_BOUND * sizeof(PulseImage));
memset(pass->readwrite_images, 0, PULSE_MAX_WRITE_TEXTURES_BOUND * sizeof(PulseImage));
memset(pass->readonly_storage_buffers, 0, PULSE_MAX_READ_BUFFERS_BOUND * sizeof(PulseBuffer));
memset(pass->readwrite_storage_buffers, 0, PULSE_MAX_WRITE_BUFFERS_BOUND * sizeof(PulseBuffer));
pass->current_pipeline = PULSE_NULL_HANDLE;
pass->is_recording = false;
}