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

Complete HLSL reserved symbols #2367

Merged
merged 2 commits into from
Jun 13, 2023
Merged

Conversation

teoxoy
Copy link
Member

@teoxoy teoxoy commented Jun 2, 2023

  • adds FXC & DXC intrinsics
  • adds FXC & DXC vector and matrix shorthands
  • adds DXC (reserved) keywords
  • adds DXC resource and other types
  • adds DXC scalar types


/// For each scalar type, it will additionally generate vector and matrix shorthands
macro_rules! generate {
($a:ident, $i:ident, [$($roots:literal),*], $x:tt) => {
Copy link
Member

Choose a reason for hiding this comment

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

If we do have to keep this macro - there's no need to pass $a and $i down to all the invocations. The @inner push case can simply refer to res and c directly, since they're visible at the point of the macro's definition.

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #2381

Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

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

Okay, I see - you want to use the macro to generate the names because you'd like to use 'static as the lifetime in the namer.

Looks good to me - just consider the $a / $i simplification I suggested.

@jimblandy jimblandy merged commit 763ec5d into gfx-rs:master Jun 13, 2023
@teoxoy teoxoy deleted the hlsl-reserved branch June 13, 2023 15:23
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