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

Function Compute_SetConstants

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

Source from the content-addressed store, hash-verified

492 }
493
494 static int Compute_SetConstants(lua_State* L)
495 {
496 DM_LUA_STACK_CHECK(L, 0);
497 ComputeResource* compute_res = CheckComputeResource(L, 1);
498
499 luaL_checktype(L, 2, LUA_TTABLE);
500 lua_pushnil(L);
501 while (lua_next(L, 2) != 0)
502 {
503 dmhash_t name_hash = dmScript::CheckHashOrString(L, -2);
504 SetComputeConstant(L, compute_res, name_hash, lua_gettop(L));
505 lua_pop(L, 1);
506 }
507 return 0;
508 }
509
510 /*# sets textures in a compute program
511 * Sets textures in a compute program, if the samplers 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
SetComputeConstantFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected