Skip to content

Commit e8c067a

Browse files
committed
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 430b606 commit e8c067a

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
@@ -698,7 +698,7 @@ jobs:
698698
# select the right runner type and whether tests are run.
699699
nametag: linux-optix-vfx2025
700700
runner: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-gpu-t4-4c-16g-176h') || 'ubuntu-latest' }}
701-
container: aswf/ci-osl:2025-clang18.2
701+
container: aswf/ci-osl:2025-clang18
702702
cxx_std: 17
703703
python_ver: "3.11"
704704
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)