Skip to content

Commit

Permalink
Fixed two mistakes in hand reconstruction that may have been the sour…
Browse files Browse the repository at this point in the history
…ce of a crash
  • Loading branch information
philipturner committed Sep 3, 2021
1 parent f7a904b commit 583befc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions AR MultiPendulum.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 6T952M2592;
ENABLE_PREVIEWS = YES;
Expand All @@ -1549,7 +1549,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 10;
CURRENT_PROJECT_VERSION = 11;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 6T952M2592;
ENABLE_PREVIEWS = YES;
Expand Down
15 changes: 7 additions & 8 deletions AR MultiPendulum/Hand Reconstruction/Detection/Kernels.metal
Original file line number Diff line number Diff line change
Expand Up @@ -238,29 +238,28 @@ kernel void locateHandCenter(device ComputeUniforms &uniforms [[ buffer(0) ]],
{
ushort2 numLessGreater(1);
ushort2 i_range = select(ushort2(0, 11), { 11, 21 }, isHelperThread);

for (ushort i = i_range[0]; i < i_range[1]; ++i)
{
float retrievedDepth = depths[i];
if (!isnan(retrievedDepth))

if (!isnan(retrievedDepth) && i != depth_id)
{
numLessGreater += select(ushort2(1, 0), { 0, 1 }, retrievedDepth < thread_depth);
}
}

if (isHelperThread)
{
tg_medianData[depth_id] = numLessGreater;
}
if (isHelperThread) { tg_medianData[depth_id] = numLessGreater; }
threadgroup_barrier(mem_flags::mem_threadgroup);

if (!isHelperThread)
{
numLessGreater += tg_medianData[depth_id];

thread_medianData = ushort2(depth_id, numLessGreater[0] * numLessGreater[1]);
tg_medianData[depth_id] = thread_medianData;
}

*shouldReturnEarly = false;
}

Expand Down

0 comments on commit 583befc

Please sign in to comment.