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