Skip to content

Commit

Permalink
Adjust to OIIO change to IC/TS API (#1850)
Browse files Browse the repository at this point in the history
Didn't catch them all in #1848 -- missed the BatchedRendererServices side.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz authored Aug 18, 2024
1 parent 5ee978d commit 9f4aa5e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/liboslexec/batched_rendservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ using namespace OSL::pvt;
OSL_NAMESPACE_ENTER


#ifdef OIIO_TEXTURESYSTEM_CREATE_SHARED
namespace {
std::mutex shared_texturesys_mutex;
std::shared_ptr<TextureSystem> shared_texturesys;
} // namespace
#endif



template<int WidthT>
BatchedRendererServices<WidthT>::BatchedRendererServices(TextureSystem* texsys)
: m_texturesys(texsys)
Expand All @@ -27,7 +36,17 @@ BatchedRendererServices<WidthT>::BatchedRendererServices(TextureSystem* texsys)
OSL_ASSERT(
0 && "RendererServices was not passed a working TextureSystem*");
#else
# ifdef OIIO_TEXTURESYSTEM_CREATE_SHARED
{
std::lock_guard<std::mutex> lock(shared_texturesys_mutex);
if (!shared_texturesys) {
shared_texturesys = TextureSystem::create(true /* shared */);
}
m_texturesys = shared_texturesys.get();
}
# else
m_texturesys = TextureSystem::create(true /* shared */);
# endif
// Make some good guesses about default options
m_texturesys->attribute("automip", 1);
m_texturesys->attribute("autotile", 64);
Expand Down

0 comments on commit 9f4aa5e

Please sign in to comment.