|
@@ -503,13 +503,32 @@ int w_Shader_hasStage(lua_State* L)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+int w_Shader_getLocalThreadgroupSize(lua_State* L)
|
|
|
+{
|
|
|
+ Shader *shader = luax_checkshader(L, 1);
|
|
|
+
|
|
|
+ if (!shader->hasStage(SHADERSTAGE_COMPUTE))
|
|
|
+ {
|
|
|
+ lua_pushnil(L);
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ int x, y, z;
|
|
|
+ shader->getLocalThreadgroupSize(&x, &y, &z);
|
|
|
+ lua_pushinteger(L, x);
|
|
|
+ lua_pushinteger(L, y);
|
|
|
+ lua_pushinteger(L, z);
|
|
|
+ return 3;
|
|
|
+}
|
|
|
+
|
|
|
static const luaL_Reg w_Shader_functions[] =
|
|
|
{
|
|
|
- { "getWarnings", w_Shader_getWarnings },
|
|
|
- { "send", w_Shader_send },
|
|
|
- { "sendColor", w_Shader_sendColors },
|
|
|
- { "hasUniform", w_Shader_hasUniform },
|
|
|
- { "hasStage", w_Shader_hasStage },
|
|
|
+ { "getWarnings", w_Shader_getWarnings },
|
|
|
+ { "send", w_Shader_send },
|
|
|
+ { "sendColor", w_Shader_sendColors },
|
|
|
+ { "hasUniform", w_Shader_hasUniform },
|
|
|
+ { "hasStage", w_Shader_hasStage },
|
|
|
+ { "getLocalThreadgroupSize", w_Shader_getLocalThreadgroupSize },
|
|
|
{ 0, 0 }
|
|
|
};
|
|
|
|