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

Function NullSetTextureAsync

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

Source from the content-addressed store, hash-verified

1911 }
1912
1913 static void NullSetTextureAsync(HContext context, HTexture texture, const TextureParams& params, SetTextureAsyncCallback callback, void* user_data)
1914 {
1915 if (g_NullContext->m_AsyncProcessingSupport && g_NullContext->m_UseAsyncTextureLoad)
1916 {
1917 {
1918 DM_MUTEX_OPTIONAL_SCOPED_LOCK(g_NullContext->m_BaseContext.m_AssetHandleContainerMutex);
1919 NullTexture* tex = GetAssetFromContainer<NullTexture>(g_NullContext->m_BaseContext.m_AssetHandleContainer, texture);
1920 int32_t v = dmAtomicGet32(&tex->m_Base.m_DataState);
1921 dmAtomicStore32(&tex->m_Base.m_DataState, v | (1 << params.m_MipMap));
1922 }
1923 uint16_t param_array_index = PushSetTextureAsyncState(g_NullContext->m_SetTextureAsyncState, texture, params, callback, user_data);
1924
1925 Job job = {0};
1926 job.m_Process = AsyncProcessCallback;
1927 job.m_Callback = AsyncCompleteCallback;
1928 job.m_Context = (void*) g_NullContext;
1929 job.m_Data = (void*) (uintptr_t) param_array_index;
1930
1931 HJob hjob = JobSystemCreateJob(g_NullContext->m_JobContext, &job);
1932 JobSystemPushJob(g_NullContext->m_JobContext, hjob);
1933 }
1934 else
1935 {
1936 SetTexture(context, texture, params);
1937 if (callback)
1938 {
1939 callback(texture, user_data);
1940 }
1941 }
1942 }
1943
1944 // Tests only
1945 void SetForceFragmentReloadFail(bool should_fail)

Callers

nothing calls this directly

Calls 6

dmAtomicGet32Function · 0.85
dmAtomicStore32Function · 0.85
PushSetTextureAsyncStateFunction · 0.85
JobSystemCreateJobFunction · 0.85
JobSystemPushJobFunction · 0.85
SetTextureFunction · 0.50

Tested by

no test coverage detected