Skip to content

Commit 8725c3c

Browse files
authored
fix: Use more modern span-based set_pixels with OIIO 3.1. (#2042)
Switch CI back to the aswf/ci-osl:2025-clang18.3 container that has OIIO 3.1, it will work fine with this change. Signed-off-by: Larry Gritz <[email protected]>
1 parent a1761c7 commit 8725c3c

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ jobs:
684684
# select the right runner type and whether tests are run.
685685
nametag: linux-optix-vfx2025
686686
runner: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-gpu-t4-4c-16g-176h') || 'ubuntu-latest' }}
687-
container: aswf/ci-osl:2025-clang18.2
687+
container: aswf/ci-osl:2025-clang18
688688
cxx_std: 17
689689
python_ver: "3.11"
690690
pybind11_ver: v2.11.1

src/testrender/optixraytracer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,11 @@ OptixRaytracer::finalize_pixel_buffer()
12521252
reinterpret_cast<void*>(d_output_buffer),
12531253
m_xres * m_yres * 3 * sizeof(float),
12541254
cudaMemcpyDeviceToHost));
1255+
#if OIIO_VERSION_GREATER_EQUAL(3, 1, 0)
1256+
pixelbuf.set_pixels(OIIO::ROI::All(), OIIO::make_cspan(tmp_buff));
1257+
#else
12551258
pixelbuf.set_pixels(OIIO::ROI::All(), OIIO::TypeFloat, tmp_buff.data());
1259+
#endif
12561260
}
12571261

12581262

src/testshade/optixgridrender.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,8 +1088,13 @@ OptixGridRenderer::finalize_pixel_buffer()
10881088
m_xres * m_yres * 3 * sizeof(float),
10891089
cudaMemcpyDeviceToHost));
10901090
OIIO::ImageBuf* buf = outputbuf(0);
1091-
if (buf)
1091+
if (buf) {
1092+
#if OIIO_VERSION_GREATER_EQUAL(3, 1, 0)
1093+
buf->set_pixels(OIIO::ROI::All(), OIIO::make_cspan(tmp_buff));
1094+
#else
10921095
buf->set_pixels(OIIO::ROI::All(), OIIO::TypeFloat, tmp_buff.data());
1096+
#endif
1097+
}
10931098
}
10941099

10951100

0 commit comments

Comments
 (0)