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

More reflection API features. #4740

Merged

Conversation

saipraveenb25
Copy link
Collaborator

@saipraveenb25 saipraveenb25 commented Jul 25, 2024

  • Lookup methods and members (by string) on types
  • Fix issue with looking up non-static members through the scope operator '::'
  • GenericReflection: Cast a decl to generic to access unspecialized generic parameter names and constraints
  • GenericReflection: Use getGenericContainer() from function, variable or type to access the 'nearest' generic parent along with specialization info
  • GenericReflection::getConcreteType and GenericReflection::getConcreteIntVal: to get the concrete type of a param in the context of the reflection object
  • GenericReflection::getOuterGenericContainer to go up one level and get the outer generic declarations (if there are more than one enclosing generic scopes)
  • DeclReflection::getParent: go to parent declaration.
  • Change VariableReflection to be a DeclRef rather than a decl (allows us to return properly substituted types for methods, members, and more)

Resolves: #4786

saipraveenb25 and others added 2 commits July 24, 2024 22:47
+ Lookup methods and members (by string) on types
+ Fix issue with looking up non-static members through the scope operator '::'
+ `GenericReflection`: Cast a decl to generic to access unspecialized generic parameter names and constraints
+ `GenericReflection`: Use `getGenericContainer()` from function, variable or type to access the 'nearest' generic parent along with specialization info
+ `GenericReflection::getConcreteType` and `GenericReflection::getConcreteIntVal`: to get the concrete type of a param in the context of the reflection object
+ `GenericReflection::getOuterGenericContainer` to go up one level and get the outer generic declarations (if there are more than one enclosing generic scopes)
+ `DeclReflection::getParent`: go to parent declaration.
+ Change `VariableReflection` to be a `DeclRef` rather than a decl (allows us to return properly substituted types for methods, members, and more)
@saipraveenb25 saipraveenb25 added pr: new feature pr: non-breaking PRs without breaking changes labels Jul 25, 2024
Copy link
Collaborator

@csyonghe csyonghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the Falcor test is breaking.

Copy link
Collaborator

@csyonghe csyonghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you for adding the unit test!

@saipraveenb25 saipraveenb25 merged commit 2f2ae8c into shader-slang:master Aug 7, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new feature pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reflection API extensions: Add support for reflecting generic containers
2 participants