@@ -307,14 +307,15 @@ osl_texture(OpaqueExecContextPtr oec, ustringhash_pod name_, void* handle,
307307 ustringhash name = ustringhash_from (name_);
308308 bool ok = rs_texture (oec, name, (TextureSystem::TextureHandle*)handle,
309309#ifndef __CUDA_ARCH__
310- sg->context ->texture_thread_info (),
310+ sg->context ->texture_thread_info (), *opt, s, t, dsdx,
311+ dtdx, dsdy, dtdy, 4 ,
311312#else
312- nullptr ,
313+ nullptr , *opt, s, t, dsdx, dtdx, dsdy, dtdy,
314+ chans + (alpha ? 1 : 0 ), // # chans we're asking
313315#endif
314- *opt, s, t, dsdx, dtdx, dsdy, dtdy, 4 ,
315316 (float *)&result_simd,
316- derivs ? (float *)&dresultds_simd : NULL ,
317- derivs ? (float *)&dresultdt_simd : NULL ,
317+ derivs ? (float *)&dresultds_simd : nullptr ,
318+ derivs ? (float *)&dresultdt_simd : nullptr ,
318319 errormessage ? &em : nullptr );
319320
320321 for (int i = 0 ; i < chans; ++i)
@@ -341,7 +342,7 @@ osl_texture(OpaqueExecContextPtr oec, ustringhash_pod name_, void* handle,
341342 }
342343
343344 if (errormessage)
344- *errormessage = ok ? ustringhash {}. hash () : em.hash ();
345+ *errormessage = em.hash ();
345346 return ok;
346347}
347348
@@ -385,11 +386,13 @@ osl_texture3d(OpaqueExecContextPtr oec, ustringhash_pod name_, void* handle,
385386 ustringhash name = ustringhash_from (name_);
386387 bool ok = rs_texture3d (oec, name, (TextureSystem::TextureHandle*)handle,
387388#ifndef __CUDA_ARCH__
388- sg->context ->texture_thread_info (),
389+ sg->context ->texture_thread_info (), *opt, P, dPdx,
390+ dPdy, dPdz, 4 ,
389391#else
390- nullptr ,
392+ nullptr , *opt, P, dPdx, dPdy, dPdz,
393+ chans + (alpha ? 1 : 0 ), // # chans we're asking
391394#endif
392- *opt, P, dPdx, dPdy, dPdz, 4 , (float *)&result_simd,
395+ (float *)&result_simd,
393396 derivs ? (float *)&dresultds_simd : nullptr ,
394397 derivs ? (float *)&dresultdt_simd : nullptr ,
395398 derivs ? (float *)&dresultdr_simd : nullptr ,
@@ -421,7 +424,7 @@ osl_texture3d(OpaqueExecContextPtr oec, ustringhash_pod name_, void* handle,
421424 }
422425
423426 if (errormessage)
424- *errormessage = ok ? ustringhash {}. hash () : em.hash ();
427+ *errormessage = em.hash ();
425428 return ok;
426429}
427430
@@ -459,12 +462,14 @@ osl_environment(OpaqueExecContextPtr oec, ustringhash_pod name_, void* handle,
459462 ustringhash name = ustringhash_from (name_);
460463 bool ok = rs_environment (oec, name, (TextureSystem::TextureHandle*)handle,
461464#ifndef __CUDA_ARCH__
462- sg->context ->texture_thread_info (),
465+ sg->context ->texture_thread_info (), *opt, R, dRdx,
466+ dRdy, 4 ,
463467#else
464- nullptr ,
468+ nullptr , *opt, R, dRdx, dRdy,
469+ chans + (alpha ? 1 : 0 ), // # chans we're asking
465470#endif
466- *opt, R, dRdx, dRdy, 4 , (float *)&local_result,
467- NULL , NULL , errormessage ? &em : nullptr );
471+ (float *)&local_result, nullptr , nullptr ,
472+ errormessage ? &em : nullptr );
468473
469474 for (int i = 0 ; i < chans; ++i)
470475 result[i] = local_result[i];
@@ -492,7 +497,7 @@ osl_environment(OpaqueExecContextPtr oec, ustringhash_pod name_, void* handle,
492497 }
493498
494499 if (errormessage)
495- *errormessage = ok ? ustringhash {}. hash () : em.hash ();
500+ *errormessage = em.hash ();
496501 return ok;
497502}
498503
0 commit comments