Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable userdata derivatives for interpolated params on GPU #1657

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/liboslexec/llvm_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,10 @@ BackendLLVM::llvm_type_groupdata()
++order;
for (int i = 0; i < nuserdata; ++i) {
TypeDesc type = types[i];
// NB: Userdata derivs are not currently supported in OptiX, since
// making room for them in the GroupData struct can result in a
// large per-thread memory allocation, which could negatively
// impact performance.
int n = (!use_optix()) ? type.numelements()
* 3 // make room for derivs by default
: type.numelements();
type.arraylen = n;
// make room for float derivs only
type.arraylen = type.basetype == TypeDesc::FLOAT
? type.numelements() * 3
: type.numelements();
fields.push_back(llvm_type(type));
m_groupdata_field_names.emplace_back(
fmtformat("userdata{}_{}_", i, names[i]));
Expand Down