Commit 2b93a86c authored by David Reid's avatar David Reid

Refactoring in preparation for generalising the job system.

parent fd58700a
...@@ -9606,7 +9606,8 @@ typedef struct ...@@ -9606,7 +9606,8 @@ typedef struct
/* Resource Managemer Jobs */ /* Resource Managemer Jobs */
struct struct
{ {
ma_resource_manager_data_buffer_node* pDataBufferNode; /*ma_resource_manager**/ void* pResourceManager;
/*ma_resource_manager_data_buffer_node**/ void* pDataBufferNode;
char* pFilePath; char* pFilePath;
wchar_t* pFilePathW; wchar_t* pFilePathW;
ma_bool32 decode; /* When set to true, the data buffer will be decoded. Otherwise it'll be encoded and will use a decoder for the connector. */ ma_bool32 decode; /* When set to true, the data buffer will be decoded. Otherwise it'll be encoded and will use a decoder for the connector. */
...@@ -9617,13 +9618,15 @@ typedef struct ...@@ -9617,13 +9618,15 @@ typedef struct
} loadDataBufferNode; } loadDataBufferNode;
struct struct
{ {
ma_resource_manager_data_buffer_node* pDataBufferNode; /*ma_resource_manager**/ void* pResourceManager;
/*ma_resource_manager_data_buffer_node**/ void* pDataBufferNode;
ma_async_notification* pDoneNotification; ma_async_notification* pDoneNotification;
ma_fence* pDoneFence; ma_fence* pDoneFence;
} freeDataBufferNode; } freeDataBufferNode;
struct struct
{ {
ma_resource_manager_data_buffer_node* pDataBufferNode; /*ma_resource_manager**/ void* pResourceManager;
/*ma_resource_manager_data_buffer_node**/ void* pDataBufferNode;
ma_decoder* pDecoder; ma_decoder* pDecoder;
ma_async_notification* pDoneNotification; /* Signalled when the data buffer has been fully decoded. */ ma_async_notification* pDoneNotification; /* Signalled when the data buffer has been fully decoded. */
ma_fence* pDoneFence; /* Passed through from LOAD_DATA_BUFFER_NODE and released when the data buffer completes decoding or an error occurs. */ ma_fence* pDoneFence; /* Passed through from LOAD_DATA_BUFFER_NODE and released when the data buffer completes decoding or an error occurs. */
...@@ -9631,7 +9634,7 @@ typedef struct ...@@ -9631,7 +9634,7 @@ typedef struct
struct struct
{ {
ma_resource_manager_data_buffer* pDataBuffer; /*ma_resource_manager_data_buffer**/ void* pDataBuffer;
ma_async_notification* pInitNotification; /* Signalled when the data buffer has been initialized and the format/channels/rate can be retrieved. */ ma_async_notification* pInitNotification; /* Signalled when the data buffer has been initialized and the format/channels/rate can be retrieved. */
ma_async_notification* pDoneNotification; /* Signalled when the data buffer has been fully decoded. */ ma_async_notification* pDoneNotification; /* Signalled when the data buffer has been fully decoded. */
ma_fence* pInitFence; /* Released when the data buffer has been initialized and the format/channels/rate can be retrieved. */ ma_fence* pInitFence; /* Released when the data buffer has been initialized and the format/channels/rate can be retrieved. */
...@@ -9639,14 +9642,14 @@ typedef struct ...@@ -9639,14 +9642,14 @@ typedef struct
} loadDataBuffer; } loadDataBuffer;
struct struct
{ {
ma_resource_manager_data_buffer* pDataBuffer; /*ma_resource_manager_data_buffer**/ void* pDataBuffer;
ma_async_notification* pDoneNotification; ma_async_notification* pDoneNotification;
ma_fence* pDoneFence; ma_fence* pDoneFence;
} freeDataBuffer; } freeDataBuffer;
struct struct
{ {
ma_resource_manager_data_stream* pDataStream; /*ma_resource_manager_data_stream**/ void* pDataStream;
char* pFilePath; /* Allocated when the job is posted, freed by the job thread after loading. */ char* pFilePath; /* Allocated when the job is posted, freed by the job thread after loading. */
wchar_t* pFilePathW; /* ^ As above ^. Only used if pFilePath is NULL. */ wchar_t* pFilePathW; /* ^ As above ^. Only used if pFilePath is NULL. */
ma_uint64 initialSeekPoint; ma_uint64 initialSeekPoint;
...@@ -9655,18 +9658,18 @@ typedef struct ...@@ -9655,18 +9658,18 @@ typedef struct
} loadDataStream; } loadDataStream;
struct struct
{ {
ma_resource_manager_data_stream* pDataStream; /*ma_resource_manager_data_stream**/ void* pDataStream;
ma_async_notification* pDoneNotification; ma_async_notification* pDoneNotification;
ma_fence* pDoneFence; ma_fence* pDoneFence;
} freeDataStream; } freeDataStream;
struct struct
{ {
ma_resource_manager_data_stream* pDataStream; /*ma_resource_manager_data_stream**/ void* pDataStream;
ma_uint32 pageIndex; /* The index of the page to decode into. */ ma_uint32 pageIndex; /* The index of the page to decode into. */
} pageDataStream; } pageDataStream;
struct struct
{ {
ma_resource_manager_data_stream* pDataStream; /*ma_resource_manager_data_stream**/ void* pDataStream;
ma_uint64 frameIndex; ma_uint64 frameIndex;
} seekDataStream; } seekDataStream;
...@@ -64562,6 +64565,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m ...@@ -64562,6 +64565,7 @@ static ma_result ma_resource_manager_data_buffer_node_acquire_critical_section(m
/* We now have everything we need to post the job to the job thread. */ /* We now have everything we need to post the job to the job thread. */
job = ma_resource_manager_job_init(MA_RESOURCE_MANAGER_JOB_LOAD_DATA_BUFFER_NODE); job = ma_resource_manager_job_init(MA_RESOURCE_MANAGER_JOB_LOAD_DATA_BUFFER_NODE);
job.order = ma_resource_manager_data_buffer_node_next_execution_order(pDataBufferNode); job.order = ma_resource_manager_data_buffer_node_next_execution_order(pDataBufferNode);
job.data.loadDataBufferNode.pResourceManager = pResourceManager;
job.data.loadDataBufferNode.pDataBufferNode = pDataBufferNode; job.data.loadDataBufferNode.pDataBufferNode = pDataBufferNode;
job.data.loadDataBufferNode.pFilePath = pFilePathCopy; job.data.loadDataBufferNode.pFilePath = pFilePathCopy;
job.data.loadDataBufferNode.pFilePathW = pFilePathWCopy; job.data.loadDataBufferNode.pFilePathW = pFilePathWCopy;
...@@ -64828,7 +64832,8 @@ stage2: ...@@ -64828,7 +64832,8 @@ stage2:
job = ma_resource_manager_job_init(MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER_NODE); job = ma_resource_manager_job_init(MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER_NODE);
job.order = ma_resource_manager_data_buffer_node_next_execution_order(pDataBufferNode); job.order = ma_resource_manager_data_buffer_node_next_execution_order(pDataBufferNode);
job.data.freeDataBufferNode.pDataBufferNode = pDataBufferNode; job.data.freeDataBufferNode.pResourceManager = pResourceManager;
job.data.freeDataBufferNode.pDataBufferNode = pDataBufferNode;
result = ma_resource_manager_post_job(pResourceManager, &job); result = ma_resource_manager_post_job(pResourceManager, &job);
if (result != MA_SUCCESS) { if (result != MA_SUCCESS) {
...@@ -66552,16 +66557,18 @@ MA_API ma_result ma_resource_manager_next_job(ma_resource_manager* pResourceMana ...@@ -66552,16 +66557,18 @@ MA_API ma_result ma_resource_manager_next_job(ma_resource_manager* pResourceMana
} }
static ma_result ma_resource_manager_process_job__load_data_buffer_node(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__load_data_buffer_node(ma_resource_manager_job* pJob)
{ {
ma_result result = MA_SUCCESS; ma_result result = MA_SUCCESS;
ma_resource_manager* pResourceManager;
ma_resource_manager_data_buffer_node* pDataBufferNode; ma_resource_manager_data_buffer_node* pDataBufferNode;
MA_ASSERT(pResourceManager != NULL);
MA_ASSERT(pJob != NULL); MA_ASSERT(pJob != NULL);
pDataBufferNode = pJob->data.loadDataBufferNode.pDataBufferNode; pResourceManager = (ma_resource_manager*)pJob->data.loadDataBufferNode.pResourceManager;
MA_ASSERT(pResourceManager != NULL);
pDataBufferNode = (ma_resource_manager_data_buffer_node*)pJob->data.loadDataBufferNode.pDataBufferNode;
MA_ASSERT(pDataBufferNode != NULL); MA_ASSERT(pDataBufferNode != NULL);
MA_ASSERT(pDataBufferNode->isDataOwnedByResourceManager == MA_TRUE); /* The data should always be owned by the resource manager. */ MA_ASSERT(pDataBufferNode->isDataOwnedByResourceManager == MA_TRUE); /* The data should always be owned by the resource manager. */
...@@ -66637,6 +66644,7 @@ static ma_result ma_resource_manager_process_job__load_data_buffer_node(ma_resou ...@@ -66637,6 +66644,7 @@ static ma_result ma_resource_manager_process_job__load_data_buffer_node(ma_resou
*/ */
pageDataBufferNodeJob = ma_resource_manager_job_init(MA_RESOURCE_MANAGER_JOB_PAGE_DATA_BUFFER_NODE); pageDataBufferNodeJob = ma_resource_manager_job_init(MA_RESOURCE_MANAGER_JOB_PAGE_DATA_BUFFER_NODE);
pageDataBufferNodeJob.order = ma_resource_manager_data_buffer_node_next_execution_order(pDataBufferNode); pageDataBufferNodeJob.order = ma_resource_manager_data_buffer_node_next_execution_order(pDataBufferNode);
pageDataBufferNodeJob.data.pageDataBufferNode.pResourceManager = pResourceManager;
pageDataBufferNodeJob.data.pageDataBufferNode.pDataBufferNode = pDataBufferNode; pageDataBufferNodeJob.data.pageDataBufferNode.pDataBufferNode = pDataBufferNode;
pageDataBufferNodeJob.data.pageDataBufferNode.pDecoder = pDecoder; pageDataBufferNodeJob.data.pageDataBufferNode.pDecoder = pDecoder;
pageDataBufferNodeJob.data.pageDataBufferNode.pDoneNotification = pJob->data.loadDataBufferNode.pDoneNotification; pageDataBufferNodeJob.data.pageDataBufferNode.pDoneNotification = pJob->data.loadDataBufferNode.pDoneNotification;
...@@ -66701,15 +66709,17 @@ done: ...@@ -66701,15 +66709,17 @@ done:
return result; return result;
} }
static ma_result ma_resource_manager_process_job__free_data_buffer_node(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__free_data_buffer_node(ma_resource_manager_job* pJob)
{ {
ma_resource_manager* pResourceManager;
ma_resource_manager_data_buffer_node* pDataBufferNode; ma_resource_manager_data_buffer_node* pDataBufferNode;
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pJob != NULL);
MA_ASSERT(pJob != NULL);
pDataBufferNode = pJob->data.freeDataBufferNode.pDataBufferNode; pResourceManager = (ma_resource_manager*)pJob->data.loadDataBufferNode.pResourceManager;
MA_ASSERT(pResourceManager != NULL);
pDataBufferNode = (ma_resource_manager_data_buffer_node*)pJob->data.freeDataBufferNode.pDataBufferNode;
MA_ASSERT(pDataBufferNode != NULL); MA_ASSERT(pDataBufferNode != NULL);
if (pJob->order != c89atomic_load_32(&pDataBufferNode->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataBufferNode->executionPointer)) {
...@@ -66731,15 +66741,18 @@ static ma_result ma_resource_manager_process_job__free_data_buffer_node(ma_resou ...@@ -66731,15 +66741,18 @@ static ma_result ma_resource_manager_process_job__free_data_buffer_node(ma_resou
return MA_SUCCESS; return MA_SUCCESS;
} }
static ma_result ma_resource_manager_process_job__page_data_buffer_node(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__page_data_buffer_node(ma_resource_manager_job* pJob)
{ {
ma_result result = MA_SUCCESS; ma_result result = MA_SUCCESS;
ma_resource_manager* pResourceManager;
ma_resource_manager_data_buffer_node* pDataBufferNode; ma_resource_manager_data_buffer_node* pDataBufferNode;
MA_ASSERT(pJob != NULL);
pResourceManager = (ma_resource_manager*)pJob->data.loadDataBufferNode.pResourceManager;
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pResourceManager != NULL);
MA_ASSERT(pJob != NULL);
pDataBufferNode = pJob->data.pageDataBufferNode.pDataBufferNode; pDataBufferNode = (ma_resource_manager_data_buffer_node*)pJob->data.pageDataBufferNode.pDataBufferNode;
MA_ASSERT(pDataBufferNode != NULL); MA_ASSERT(pDataBufferNode != NULL);
if (pJob->order != c89atomic_load_32(&pDataBufferNode->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataBufferNode->executionPointer)) {
...@@ -66803,9 +66816,10 @@ done: ...@@ -66803,9 +66816,10 @@ done:
} }
static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_manager_job* pJob)
{ {
ma_result result = MA_SUCCESS; ma_result result = MA_SUCCESS;
ma_resource_manager* pResourceManager;
ma_resource_manager_data_buffer* pDataBuffer; ma_resource_manager_data_buffer* pDataBuffer;
ma_resource_manager_data_supply_type dataSupplyType = ma_resource_manager_data_supply_type_unknown; ma_resource_manager_data_supply_type dataSupplyType = ma_resource_manager_data_supply_type_unknown;
ma_bool32 isConnectorInitialized = MA_FALSE; ma_bool32 isConnectorInitialized = MA_FALSE;
...@@ -66814,12 +66828,13 @@ static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_m ...@@ -66814,12 +66828,13 @@ static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_m
All we're doing here is checking if the node has finished loading. If not, we just re-post the job All we're doing here is checking if the node has finished loading. If not, we just re-post the job
and keep waiting. Otherwise we increment the execution counter and set the buffer's result code. and keep waiting. Otherwise we increment the execution counter and set the buffer's result code.
*/ */
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pJob != NULL);
MA_ASSERT(pJob != NULL);
pDataBuffer = pJob->data.loadDataBuffer.pDataBuffer; pDataBuffer = (ma_resource_manager_data_buffer*)pJob->data.loadDataBuffer.pDataBuffer;
MA_ASSERT(pDataBuffer != NULL); MA_ASSERT(pDataBuffer != NULL);
pResourceManager = pDataBuffer->pResourceManager;
if (pJob->order != c89atomic_load_32(&pDataBuffer->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataBuffer->executionPointer)) {
return ma_resource_manager_post_job(pResourceManager, pJob); /* Attempting to execute out of order. Probably interleaved with a MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER job. */ return ma_resource_manager_post_job(pResourceManager, pJob); /* Attempting to execute out of order. Probably interleaved with a MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER job. */
} }
...@@ -66870,7 +66885,7 @@ static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_m ...@@ -66870,7 +66885,7 @@ static ma_result ma_resource_manager_process_job__load_data_buffer(ma_resource_m
done: done:
/* Only move away from a busy code so that we don't trash any existing error codes. */ /* Only move away from a busy code so that we don't trash any existing error codes. */
c89atomic_compare_and_swap_i32(&pJob->data.loadDataBuffer.pDataBuffer->result, MA_BUSY, result); c89atomic_compare_and_swap_i32(&pDataBuffer->result, MA_BUSY, result);
/* Only signal the other threads after the result has been set just for cleanliness sake. */ /* Only signal the other threads after the result has been set just for cleanliness sake. */
if (pJob->data.loadDataBuffer.pDoneNotification != NULL) { if (pJob->data.loadDataBuffer.pDoneNotification != NULL) {
...@@ -66897,16 +66912,18 @@ done: ...@@ -66897,16 +66912,18 @@ done:
return result; return result;
} }
static ma_result ma_resource_manager_process_job__free_data_buffer(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__free_data_buffer(ma_resource_manager_job* pJob)
{ {
ma_resource_manager* pResourceManager;
ma_resource_manager_data_buffer* pDataBuffer; ma_resource_manager_data_buffer* pDataBuffer;
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pJob != NULL);
MA_ASSERT(pJob != NULL);
pDataBuffer = pJob->data.freeDataBuffer.pDataBuffer; pDataBuffer = (ma_resource_manager_data_buffer*)pJob->data.freeDataBuffer.pDataBuffer;
MA_ASSERT(pDataBuffer != NULL); MA_ASSERT(pDataBuffer != NULL);
pResourceManager = pDataBuffer->pResourceManager;
if (pJob->order != c89atomic_load_32(&pDataBuffer->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataBuffer->executionPointer)) {
return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */ return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */
} }
...@@ -66926,19 +66943,21 @@ static ma_result ma_resource_manager_process_job__free_data_buffer(ma_resource_m ...@@ -66926,19 +66943,21 @@ static ma_result ma_resource_manager_process_job__free_data_buffer(ma_resource_m
return MA_SUCCESS; return MA_SUCCESS;
} }
static ma_result ma_resource_manager_process_job__load_data_stream(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__load_data_stream(ma_resource_manager_job* pJob)
{ {
ma_result result = MA_SUCCESS; ma_result result = MA_SUCCESS;
ma_decoder_config decoderConfig; ma_decoder_config decoderConfig;
ma_uint32 pageBufferSizeInBytes; ma_uint32 pageBufferSizeInBytes;
ma_resource_manager* pResourceManager;
ma_resource_manager_data_stream* pDataStream; ma_resource_manager_data_stream* pDataStream;
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pJob != NULL);
MA_ASSERT(pJob != NULL);
pDataStream = pJob->data.loadDataStream.pDataStream; pDataStream = (ma_resource_manager_data_stream*)pJob->data.loadDataStream.pDataStream;
MA_ASSERT(pDataStream != NULL); MA_ASSERT(pDataStream != NULL);
pResourceManager = pDataStream->pResourceManager;
if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) {
return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */ return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */
} }
...@@ -67010,16 +67029,18 @@ done: ...@@ -67010,16 +67029,18 @@ done:
return result; return result;
} }
static ma_result ma_resource_manager_process_job__free_data_stream(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__free_data_stream(ma_resource_manager_job* pJob)
{ {
ma_resource_manager* pResourceManager;
ma_resource_manager_data_stream* pDataStream; ma_resource_manager_data_stream* pDataStream;
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pJob != NULL);
MA_ASSERT(pJob != NULL);
pDataStream = pJob->data.freeDataStream.pDataStream; pDataStream = (ma_resource_manager_data_stream*)pJob->data.freeDataStream.pDataStream;
MA_ASSERT(pDataStream != NULL); MA_ASSERT(pDataStream != NULL);
pResourceManager = pDataStream->pResourceManager;
if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) {
return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */ return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */
} }
...@@ -67050,17 +67071,19 @@ static ma_result ma_resource_manager_process_job__free_data_stream(ma_resource_m ...@@ -67050,17 +67071,19 @@ static ma_result ma_resource_manager_process_job__free_data_stream(ma_resource_m
return MA_SUCCESS; return MA_SUCCESS;
} }
static ma_result ma_resource_manager_process_job__page_data_stream(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__page_data_stream(ma_resource_manager_job* pJob)
{ {
ma_result result = MA_SUCCESS; ma_result result = MA_SUCCESS;
ma_resource_manager* pResourceManager;
ma_resource_manager_data_stream* pDataStream; ma_resource_manager_data_stream* pDataStream;
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pJob != NULL);
MA_ASSERT(pJob != NULL);
pDataStream = pJob->data.pageDataStream.pDataStream; pDataStream = (ma_resource_manager_data_stream*)pJob->data.pageDataStream.pDataStream;
MA_ASSERT(pDataStream != NULL); MA_ASSERT(pDataStream != NULL);
pResourceManager = pDataStream->pResourceManager;
if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) {
return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */ return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */
} }
...@@ -67078,17 +67101,19 @@ done: ...@@ -67078,17 +67101,19 @@ done:
return result; return result;
} }
static ma_result ma_resource_manager_process_job__seek_data_stream(ma_resource_manager* pResourceManager, ma_resource_manager_job* pJob) static ma_result ma_resource_manager_process_job__seek_data_stream(ma_resource_manager_job* pJob)
{ {
ma_result result = MA_SUCCESS; ma_result result = MA_SUCCESS;
ma_resource_manager* pResourceManager;
ma_resource_manager_data_stream* pDataStream; ma_resource_manager_data_stream* pDataStream;
MA_ASSERT(pResourceManager != NULL); MA_ASSERT(pJob != NULL);
MA_ASSERT(pJob != NULL);
pDataStream = pJob->data.seekDataStream.pDataStream; pDataStream = (ma_resource_manager_data_stream*)pJob->data.seekDataStream.pDataStream;
MA_ASSERT(pDataStream != NULL); MA_ASSERT(pDataStream != NULL);
pResourceManager = pDataStream->pResourceManager;
if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) { if (pJob->order != c89atomic_load_32(&pDataStream->executionPointer)) {
return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */ return ma_resource_manager_post_job(pResourceManager, pJob); /* Out of order. */
} }
...@@ -67125,19 +67150,19 @@ MA_API ma_result ma_resource_manager_process_job(ma_resource_manager* pResourceM ...@@ -67125,19 +67150,19 @@ MA_API ma_result ma_resource_manager_process_job(ma_resource_manager* pResourceM
switch (pJob->toc.breakup.code) switch (pJob->toc.breakup.code)
{ {
/* Data Buffer Node */ /* Data Buffer Node */
case MA_RESOURCE_MANAGER_JOB_LOAD_DATA_BUFFER_NODE: return ma_resource_manager_process_job__load_data_buffer_node(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_LOAD_DATA_BUFFER_NODE: return ma_resource_manager_process_job__load_data_buffer_node(pJob);
case MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER_NODE: return ma_resource_manager_process_job__free_data_buffer_node(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER_NODE: return ma_resource_manager_process_job__free_data_buffer_node(pJob);
case MA_RESOURCE_MANAGER_JOB_PAGE_DATA_BUFFER_NODE: return ma_resource_manager_process_job__page_data_buffer_node(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_PAGE_DATA_BUFFER_NODE: return ma_resource_manager_process_job__page_data_buffer_node(pJob);
/* Data Buffer */ /* Data Buffer */
case MA_RESOURCE_MANAGER_JOB_LOAD_DATA_BUFFER: return ma_resource_manager_process_job__load_data_buffer(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_LOAD_DATA_BUFFER: return ma_resource_manager_process_job__load_data_buffer(pJob);
case MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER: return ma_resource_manager_process_job__free_data_buffer(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_FREE_DATA_BUFFER: return ma_resource_manager_process_job__free_data_buffer(pJob);
/* Data Stream */ /* Data Stream */
case MA_RESOURCE_MANAGER_JOB_LOAD_DATA_STREAM: return ma_resource_manager_process_job__load_data_stream(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_LOAD_DATA_STREAM: return ma_resource_manager_process_job__load_data_stream(pJob);
case MA_RESOURCE_MANAGER_JOB_FREE_DATA_STREAM: return ma_resource_manager_process_job__free_data_stream(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_FREE_DATA_STREAM: return ma_resource_manager_process_job__free_data_stream(pJob);
case MA_RESOURCE_MANAGER_JOB_PAGE_DATA_STREAM: return ma_resource_manager_process_job__page_data_stream(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_PAGE_DATA_STREAM: return ma_resource_manager_process_job__page_data_stream(pJob);
case MA_RESOURCE_MANAGER_JOB_SEEK_DATA_STREAM: return ma_resource_manager_process_job__seek_data_stream(pResourceManager, pJob); case MA_RESOURCE_MANAGER_JOB_SEEK_DATA_STREAM: return ma_resource_manager_process_job__seek_data_stream(pJob);
default: break; default: break;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment