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

Function Compute_SetSamplers

engine/gamesys/src/gamesys/scripts/script_compute.cpp:396–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394 }
395
396 static int Compute_SetSamplers(lua_State* L)
397 {
398 DM_LUA_STACK_CHECK(L, 0);
399 ComputeResource* compute_res = CheckComputeResource(L, 1);
400
401 luaL_checktype(L, 2, LUA_TTABLE);
402 lua_pushnil(L);
403 while (lua_next(L, 2) != 0)
404 {
405 dmhash_t name_hash = dmScript::CheckHashOrString(L, -2);
406 SetComputeSampler(L, compute_res, name_hash, lua_gettop(L));
407 lua_pop(L, 1);
408 }
409 return 0;
410 }
411
412 /*# sets shader constants in a compute program
413 * Sets shader constants in a compute program, if the constants exist.

Callers

nothing calls this directly

Calls 7

CheckComputeResourceFunction · 0.85
luaL_checktypeFunction · 0.85
lua_pushnilFunction · 0.85
lua_nextFunction · 0.85
CheckHashOrStringFunction · 0.85
SetComputeSamplerFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected