AcademySoftwareFoundation / AcademySoftwareFoundation/OpenShadingLanguage

asymmetry for userdata vs attributes with ShadingSystemImpl::getattribute

Open
#1,622 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.3k
Forks
414
Avg merge
3d 1h
Merged PRs (30d)
10

Description

### Problem

In https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/bd7fd4cf8cd4b0b75c52715737b64b204bc585bf/src/liboslexec/shadingsys.cpp#L1927 we have:

- num_userdata
- userdata_names
- userdata_types
- userdata_offsets
- userdata_derivs

but only:
- num_attributes_needed
- attributes_needed
- attribute_scopes
- unknown_attributes_needed

which is missing a types, offsets and derivs for attributes.

This issue is to log the need for parity across these.

The mis-matching names are already a little bit confusing, so some kind of homogenization would also make sense.

**Expected behavior:**

I expect userdata and attributes to provide the same abilities for query during llvm compilation.

**Actual behavior:**

I don't have parity for userdata and attribute queries.

### Steps to Reproduce

NA

### Versions

* OSL branch/version: ALL
* OS: ALL
* C++ compiler: ALL
* LLVM version: ALL
* OIIO version: ALL

### NOTE

I know this should be a PR, which I'll try and get to, but for the moment, I figured an issue would make sense.

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start in src/liboslexec/shadingsys.cpp around line 1927 and compare the userdata and attribute query data exposed during LLVM compilation. Define what parity for attribute types, offsets, and derivatives should mean, including whether the existing names should be homogenized; done means both query paths provide the same capabilities.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.