Skip to content

[spirv] Add support for [[vk::shader_record_nv]]#2179

Merged
ehsannas merged 2 commits into
microsoft:masterfrom
alelenv:nv_shader_record_final
May 16, 2019
Merged

[spirv] Add support for [[vk::shader_record_nv]]#2179
ehsannas merged 2 commits into
microsoft:masterfrom
alelenv:nv_shader_record_final

Conversation

@alelenv
Copy link
Copy Markdown
Contributor

@alelenv alelenv commented May 10, 2019

@ehsannas
Please review fix for issue #2019
Tests have been added along with documentation update.

Thanks

@AppVeyorBot
Copy link
Copy Markdown

@ehsannas ehsannas self-requested a review May 13, 2019 21:52
@ehsannas ehsannas changed the title Add support for [[vk::shader_record_nv]] [spirv] Add support for [[vk::shader_record_nv]] May 13, 2019
@ehsannas
Copy link
Copy Markdown
Contributor

Great! Thanks @alelenv . I'll take a look.

@ehsannas ehsannas added the spirv Work related to SPIR-V label May 13, 2019
Copy link
Copy Markdown
Contributor

@ehsannas ehsannas left a comment

Choose a reason for hiding this comment

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

Nice job! So happy to see documentation and tests! Looks good to me overall; Just a couple of nits pointed out below.

astDecls[decl] = DeclSpirvInfo(var);

// Do not push this variable into resourceVars since it does not need
// descriptor set.
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.

Thanks for the comment here

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.

I think you should also add

// CHECK-NOT: OpDecoration %bla DescriptorSet
// CHECK-NOT: OpDecoration %bla Binding

to your tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a good idea. Added to tests


// We still register all VarDecls seperately here. All the VarDecls are
// mapped to the <result-id> of the buffer object, which means when querying
// querying the <result-id> for a certain VarDecl, we need to do an extra
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.

Typo: 'querying' repeated ;)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

}
if (decl->hasAttr<VKBindingAttr>()) {
emitError("vk::shader_record_nv attribute cannot be used together with "
"vk::binding attribute",
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.

Can we add a test to make sure this error is emitted when needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added test to vk.attribute.invalid.hlsl

@alelenv
Copy link
Copy Markdown
Contributor Author

alelenv commented May 15, 2019

Thanks for quick turnaround of review

@AppVeyorBot
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@ehsannas ehsannas left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @alelenv

@ehsannas ehsannas merged commit b830b09 into microsoft:master May 16, 2019
jaebaek pushed a commit that referenced this pull request Feb 8, 2021
I added support for the Shader Record buffer for the Khronos extension.
The code is adapted from [this](#2179) previous merge.

It should fix this issue #3177
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.

3 participants