Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Complete HLSL reserved symbols#2367

Merged
jimblandy merged 2 commits intogfx-rs:masterfrom
teoxoy:hlsl-reserved
Jun 13, 2023
Merged

Complete HLSL reserved symbols#2367
jimblandy merged 2 commits intogfx-rs:masterfrom
teoxoy:hlsl-reserved

Conversation

@teoxoy
Copy link
Copy Markdown
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

Comment thread src/back/hlsl/keywords.rs
Comment thread src/back/hlsl/keywords.rs

/// 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants