MCPcopy Create free account
hub / github.com/defold/defold / AsyncProcessCallback

Function AsyncProcessCallback

engine/graphics/src/null/graphics_null.cpp:1879–1896  ·  view source on GitHub ↗

Called on worker thread

Source from the content-addressed store, hash-verified

1877
1878 // Called on worker thread
1879 static int AsyncProcessCallback(HJobContext, HJob hjob, void* pcontext, void* data)
1880 {
1881 HContext _context = (HContext)pcontext;
1882 NullContext* context = (NullContext*) _context;
1883 uint16_t param_array_index = (uint16_t) (size_t) data;
1884 SetTextureAsyncParams ap = GetSetTextureAsyncParams(context->m_SetTextureAsyncState, param_array_index);
1885
1886 DM_MUTEX_OPTIONAL_SCOPED_LOCK(context->m_BaseContext.m_AssetHandleContainerMutex);
1887 NullTexture* tex = GetAssetFromContainer<NullTexture>(context->m_BaseContext.m_AssetHandleContainer, ap.m_Texture);
1888 if (tex)
1889 {
1890 SetTexture(_context, ap.m_Texture, ap.m_Params);
1891 int32_t v = dmAtomicGet32(&tex->m_Base.m_DataState);
1892 dmAtomicStore32(&tex->m_Base.m_DataState, v & ~(1<<ap.m_Params.m_MipMap));
1893 }
1894
1895 return 0;
1896 }
1897
1898 // Called on thread where we update (which should be the main thread)
1899 static void AsyncCompleteCallback(HJobContext, HJob hjob, JobSystemStatus status, void* _context, void* data, int result)

Callers

nothing calls this directly

Calls 4

GetSetTextureAsyncParamsFunction · 0.85
dmAtomicGet32Function · 0.85
dmAtomicStore32Function · 0.85
SetTextureFunction · 0.50

Tested by

no test coverage detected