Skip to content

Commit

Permalink
add option for parallel texture fetch (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
headupinclouds authored Jul 12, 2018
1 parent 08c3e8a commit cd17f3e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,25 @@

### acf_shaders ### : for acf lib and tests
if(ACF_BUILD_OGLES_GPGPU)

add_library(acf_shaders ${ACF_GPU_SRCS} ${ACF_GPU_HDRS})
target_link_libraries(acf_shaders PUBLIC ogles_gpgpu::ogles_gpgpu)
set(acf_modules acf_shaders)

# Allow parallel texture fetches on iOS by default, but allow
# the user to disable. This is a hedge as iOS texture cache
# stuff has almost no documentation.
if(IOS)
set(acf_parallel_textures ON)
else()
set(acf_parallel_textures OFF)
endif()
option(ACF_PARALLEL_TEXTURE_FETCH "Fetch textures in parallel" ${acf_parallel_textures})

if(ACF_PARALLEL_TEXTURE_FETCH)
target_compile_definitions(acf_shaders PUBLIC ACF_PARALLEL_TEXTURE_FETCH=1)
endif()

endif()

### acf ###
Expand Down
4 changes: 2 additions & 2 deletions src/lib/acf/acf/GPUACF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,8 @@ cv::Mat ACF::getChannelsImpl()
}
}; // clang-format on

#if OGLES_GPGPU_IOS
// iOS texture cache can be queried in parallel:
#if defined(ACF_PARALLEL_TEXTURE_FETCH)
// iOS texture cache can be queried in parallel (at least):
cv::parallel_for_({ 0, int(planeIndex.size()) }, worker);
#else
worker({ 0, int(planeIndex.size()) });
Expand Down

0 comments on commit cd17f3e

Please sign in to comment.