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

Add named component access and swizzling operations to vector types. #836

Closed
wants to merge 4 commits into from

Conversation

marsupial
Copy link
Contributor

Description

Accessing/reordering channels via rgb/xyz selectors makes for much more readable code.
Also porting GLSL code to OSL can be quite tedious if it make extensive use of swizzling.

Tests

testsuite/oslc-err-swizzle
testsuite/swizzle

Checklist:

  • I have read the contribution guidelines.
  • I have previously submitted a Contributor License Agreement.
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

@marsupial marsupial force-pushed the swizzle branch 4 times, most recently from 27929a9 to eb7ad07 Compare December 19, 2017 11:21
@marsupial marsupial changed the title Add swizzling operations to language. Add named component access and swizzling operations to vector types. Dec 29, 2017
@marsupial
Copy link
Contributor Author

Appreciate the time spent integrating the other PR's over the weeks so if these two are low priority let me know.

You had previously also expressed interest in method call syntax, but less so in swizzling.
Component access was less clear, but there is a bit of overlap here with #839 as:
(in my opinion) this.r is way better than this[0] (which [also in my opinion] should not be legal syntax).

@lgritz
Copy link
Collaborator

lgritz commented Aug 6, 2019

Closing. (Sorry, Roman.)

I have an independent and simpler implementation coming soon for the parts of this feature that I like (and omitting the parts I don't like from a language design perspective).

@lgritz lgritz closed this Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants