Skip to content

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

Merged
Jaebaek Seo (jaebaek) merged 2 commits into
microsoft:masterfrom
jaebaek:ext_decorate_id
Jan 21, 2022
Merged

Jaebaek Seo (jaebaek) merged 2 commits into
microsoft:masterfrom
jaebaek:ext_decorate_id

Conversation

@jaebaek

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Collaborator Author

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

@AppVeyorBot

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 Seo (jaebaek) merged commit 8c6767e into microsoft:master Jan 21, 2022
@jaebaek
Jaebaek Seo (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