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

[spirv] support [[vk::ext_decorate_id]] attribute #4194

Merged
merged 2 commits into from
Jan 21, 2022

Conversation

jaebaek
Copy link
Collaborator

@jaebaek jaebaek commented Jan 18, 2022

As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds
vk::ext_decorate_id attribute.

Related to #3919

As a part of HLSL version of GL_EXT_spirv_intrinsics, this commit adds
vk::ext_decorate_id attribute.

Related to microsoft#3919
@jaebaek jaebaek added the spirv Work related to SPIR-V label Jan 18, 2022
@jaebaek jaebaek self-assigned this Jan 18, 2022
@jaebaek
Copy link
Collaborator Author

jaebaek commented Jan 18, 2022

@jiaolu This is another PR for #3919. Could you please review the code?

@AppVeyorBot
Copy link

const auto &stringWords = string::encodeSPIRVString(strParam);
params.insert(params.end(), stringWords.begin(), stringWords.end());
for (llvm::StringRef str : strParams) {
const auto &stringWords = string::encodeSPIRVString(str);
Copy link
Contributor

Choose a reason for hiding this comment

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

so you want to have with multiple strings input to the ext_decorate_string
vk::ext_decorate_string(5635, "return", "variable", "kk0")]]

and concatenate all the string together at the end .

It looks like syntax sugar to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is a minor change because the only decoration I know that we use for OpDecorateString is UserSemantic and it has only a single parameter, which means your initial implementation looks good for the current SPIR-V spec.

However, I checked OpDecorateString and just wanted to make it the same as its actual operands in the spec. It has "Optional Literals See Decoration." as the last operand that specifies zero or multiple string literals at the end.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a minor change because the only decoration I know that we use for OpDecorateString is UserSemantic and it has only a single parameter, which means your initial implementation looks good for the current SPIR-V spec.

However, I checked OpDecorateString and just wanted to make it the same as its actual operands in the spec. It has "Optional Literals See Decoration." as the last operand that specifies zero or multiple string literals at the end.

The operands here means multiple literals, not multiple strings.

Actually, the spirv specifically says,
"
OpDecorateString (OpDecorateStringGOOGLE)

Add a string Decoration to another .
"
"Add A string", i guess it means one string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops. Ok. I will doulecheck it and open an issue for it.

@jaebaek jaebaek merged commit 8c6767e into microsoft:master Jan 21, 2022
@jaebaek jaebaek deleted the ext_decorate_id branch January 21, 2022 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spirv Work related to SPIR-V
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants