Skip to content

Commit

Permalink
Equalize with the develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lhog committed Feb 22, 2021
1 parent efcfd57 commit 6571318
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions rts/Lua/LuaOpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2442,10 +2442,15 @@ int LuaOpenGL::DispatchCompute(lua_State* L)
const GLuint numGroupY = (GLuint)luaL_checknumber(L, 2);
const GLuint numGroupZ = (GLuint)luaL_checknumber(L, 3);

GLint maxNumGroups[3];
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &maxNumGroups[0]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &maxNumGroups[1]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &maxNumGroups[2]);
const auto maxCompWGFunc = []() {
std::array<GLint, 3> maxNumGroups;
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, &maxNumGroups[0]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, &maxNumGroups[1]);
glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, &maxNumGroups[2]);
return maxNumGroups;
};

static std::array<GLint, 3> maxNumGroups = maxCompWGFunc();

if (numGroupX < 0 && numGroupX > maxNumGroups[0] ||
numGroupY < 0 && numGroupY > maxNumGroups[1] ||
Expand Down
1 change: 1 addition & 0 deletions rts/Rendering/Textures/TextureAtlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ bool CTextureAtlas::CreateTexture()

pbo.Invalidate();
pbo.Unbind();
pbo.Release();

return (data != nullptr);
}
Expand Down

0 comments on commit 6571318

Please sign in to comment.