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

Instrument: Fix bindless checking for BufferDeviceAddress #5049

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

jeremyg-lunarg
Copy link
Contributor

@jeremyg-lunarg jeremyg-lunarg commented Jan 5, 2023

Avoid using OpConstantNull with types that do not allow it.

Update existing tests for slight changes in code generation.

Add new tests based on the Vulkan Validation layer test case that exposed this problem.

This is a fix for KhronosGroup/Vulkan-ValidationLayers#4983

@jeremyg-lunarg jeremyg-lunarg marked this pull request as draft January 5, 2023 21:03
@jeremyg-lunarg jeremyg-lunarg force-pushed the jeremyg-opconstant-null branch 2 times, most recently from 6577089 to 9c2151a Compare January 6, 2023 18:14
@jeremyg-lunarg jeremyg-lunarg marked this pull request as ready for review January 6, 2023 22:41
@jeremyg-lunarg
Copy link
Contributor Author

This change has been confirmed to fix the linked Vulkan-ValidationLayers bug

@dneto0 dneto0 requested a review from s-perron January 11, 2023 19:31
Copy link
Collaborator

@dneto0 dneto0 left a comment

Choose a reason for hiding this comment

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

Seems ok to me but I'm not comfortable enough as a code owner.
Would like @greg-lunarg or @s-perron to formally approve

@greg-lunarg
Copy link
Contributor

Would like @greg-lunarg or @s-perron to formally approve

@dneto0 I will review..

Comment on lines 574 to 580
std::unique_ptr<Instruction> cap_int64_inst(
new Instruction(context(), spv::Op::OpCapability, 0, 0,
std::initializer_list<Operand>{
{SPV_OPERAND_TYPE_CAPABILITY,
{uint32_t(spv::Capability::Int64)}}}));
get_def_use_mgr()->AnalyzeInstDefUse(&*cap_int64_inst);
context()->AddCapability(std::move(cap_int64_inst));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could replace these 7 lines with: context()->AddCapability(spv::Capability::Int64).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IRContext::AddCapability() does the HasCapability() check internally so it doesn't need to be checked by the caller. I also fixed the other 2 places where the instrumentation code adds capabilities, one of which is for the same problem I'm fixing here.

source/opt/inst_bindless_check_pass.cpp Show resolved Hide resolved
Avoid using OpConstantNull with types that do not allow it.

Update existing tests for slight changes in code generation.

Add new tests based on the Vulkan Validation layer test case
that exposed this problem.
@jeremyg-lunarg jeremyg-lunarg force-pushed the jeremyg-opconstant-null branch from 9c2151a to 690cce2 Compare January 12, 2023 15:13
@jeremyg-lunarg jeremyg-lunarg requested review from greg-lunarg and removed request for s-perron January 12, 2023 15:16
Copy link
Contributor

@greg-lunarg greg-lunarg left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for doing that additional cleanup!

@jeremyg-lunarg
Copy link
Contributor Author

@s-perron & @dneto0 Is there anything else needed to get this merged? Thanks!

@s-perron
Copy link
Collaborator

Not all of the CIs ran. If they all pass, we can merge it.

@jeremyg-lunarg
Copy link
Contributor Author

Not all of the CIs ran. If they all pass, we can merge it.

Is that the purpose of the kokoro:run label you added 4 days ago? Or is there something I need to do to trigger CI?

@s-perron
Copy link
Collaborator

The label should be good enough, but the bots do not seem to be responding. I'm looking into it now.

@s-perron
Copy link
Collaborator

The bots where still looking for PRs to the master branch instead of main. I've fixed that up. I'll give it a little time, so see if it worked.

@s-perron s-perron merged commit ba4c9fe into KhronosGroup:main Jan 16, 2023
dnovillo added a commit to dnovillo/SPIRV-Tools that referenced this pull request Jan 17, 2023
dnovillo added a commit that referenced this pull request Jan 17, 2023
@jeremyg-lunarg jeremyg-lunarg deleted the jeremyg-opconstant-null branch January 17, 2023 16:13
dneto0 added a commit to dneto0/shaderc that referenced this pull request Jan 18, 2023
dneto0 added a commit to dneto0/shaderc that referenced this pull request Jan 18, 2023
dneto0 added a commit to google/shaderc that referenced this pull request Jan 18, 2023
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.

5 participants