Skip to content

Commit 64009ec

Browse files
committed
Change rs_allocate_debug_closure to take the closure id
Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent 666a78f commit 64009ec

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/include/OSL/rs_free_function.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,11 @@ rs_allocate_closure(OSL::OpaqueExecContextPtr oec, size_t size,
327327
/// of rs_allocate_closure when the closure being allocated is the OSL
328328
/// `debug()` closure. Renderers can override this to handle debug closures
329329
/// differently (e.g., allocate from a separate pool, or return nullptr to
330-
/// suppress debug closures in production builds). The default fallback
330+
/// suppress debug closures in production builds). The `id` parameter is the
331+
/// closure ID as registered by the renderer. The default fallback
331332
/// implementation simply delegates to rs_allocate_closure.
332333
OSL_RSOP OSL_HOSTDEVICE void*
333-
rs_allocate_debug_closure(OSL::OpaqueExecContextPtr oec, size_t size,
334+
rs_allocate_debug_closure(OSL::OpaqueExecContextPtr oec, int id, size_t size,
334335
size_t alignment);
335336

336337
/// Report errors, warnings, printf, and fprintf.

src/liboslexec/opclosure.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ osl_allocate_debug_closure_component(OpaqueExecContextPtr oec, int id, int size)
120120
{
121121
const size_t needed = sizeof(ClosureComponent) + size;
122122
ClosureComponent* comp
123-
= (ClosureComponent*)rs_allocate_debug_closure(oec, needed,
123+
= (ClosureComponent*)rs_allocate_debug_closure(oec, id, needed,
124124
alignof(ClosureComponent));
125125
if (comp) {
126126
comp->id = id;
@@ -140,7 +140,7 @@ osl_allocate_weighted_debug_closure_component(OpaqueExecContextPtr oec, int id,
140140
return NULL;
141141
const size_t needed = sizeof(ClosureComponent) + size;
142142
ClosureComponent* comp
143-
= (ClosureComponent*)rs_allocate_debug_closure(oec, needed,
143+
= (ClosureComponent*)rs_allocate_debug_closure(oec, id, needed,
144144
alignof(ClosureComponent));
145145
if (comp) {
146146
comp->id = id;

src/liboslexec/rs_fallback.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ rs_allocate_closure(OSL::OpaqueExecContextPtr exec_ctx, size_t size,
330330
}
331331

332332
OSL_RSOP OSL_HOSTDEVICE void*
333-
rs_allocate_debug_closure(OSL::OpaqueExecContextPtr exec_ctx, size_t size,
334-
size_t alignment)
333+
rs_allocate_debug_closure(OSL::OpaqueExecContextPtr exec_ctx, int id,
334+
size_t size, size_t alignment)
335335
{
336336
return rs_allocate_closure(exec_ctx, size, alignment);
337337
}

src/testshade/rs_simplerend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ rs_allocate_closure(OSL::OpaqueExecContextPtr ec, size_t size, size_t alignment)
392392
}
393393

394394
OSL_RSOP OSL_HOSTDEVICE void*
395-
rs_allocate_debug_closure(OSL::OpaqueExecContextPtr ec, size_t size,
395+
rs_allocate_debug_closure(OSL::OpaqueExecContextPtr ec, int id, size_t size,
396396
size_t alignment)
397397
{
398398
return rs_allocate_closure(ec, size, alignment);

0 commit comments

Comments
 (0)