mirror of
https://github.com/italicsjenga/portability.git
synced 2024-11-22 23:11:30 +11:00
Implement gfxGetPipelineCacheData
This commit is contained in:
parent
3173cdda25
commit
fdcb2add5b
|
@ -1971,13 +1971,23 @@ pub unsafe extern "C" fn gfxDestroyPipelineCache(
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
pub unsafe extern "C" fn gfxGetPipelineCacheData(
|
pub unsafe extern "C" fn gfxGetPipelineCacheData(
|
||||||
_gpu: VkDevice,
|
gpu: VkDevice,
|
||||||
_pipelineCache: VkPipelineCache,
|
pipelineCache: VkPipelineCache,
|
||||||
pDataSize: *mut usize,
|
pDataSize: *mut usize,
|
||||||
_pData: *mut c_void,
|
pData: *mut c_void,
|
||||||
) -> VkResult {
|
) -> VkResult {
|
||||||
//TODO: save
|
let data = match gpu.device.get_pipeline_cache_data(&pipelineCache) {
|
||||||
*pDataSize = 0;
|
Ok(data) => data,
|
||||||
|
Err(oom) => return map_oom(oom)
|
||||||
|
};
|
||||||
|
|
||||||
|
if pData.is_null() {
|
||||||
|
*pDataSize = data.len();
|
||||||
|
} else {
|
||||||
|
let output = slice::from_raw_parts_mut(pData as *mut u8, *pDataSize);
|
||||||
|
output.copy_from_slice(&data);
|
||||||
|
}
|
||||||
|
|
||||||
VkResult::VK_SUCCESS
|
VkResult::VK_SUCCESS
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in a new issue