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

Correctly report liveness of variables passed as function parameters #267

Merged

Conversation

daniel-story
Copy link
Contributor

Closes #102

@CLAassistant
Copy link

CLAassistant commented Jun 26, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@chaoticbob chaoticbob left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, looks good overall. Just a two nits.

spirv_reflect.c Outdated Show resolved Hide resolved
const uint32_t result_index = p_node->word_offset + 2;
for (uint32_t j = 0, parameter_count = p_node->word_count - 4; j < parameter_count; j++) {
const uint32_t ptr_index = p_node->word_offset + 4 + j;
SpvReflectPrvAccessedVariable* access_ptr = &p_func->accessed_variables[p_func->accessed_variable_count];
Copy link
Contributor

Choose a reason for hiding this comment

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

Does access_ptr indicate that it's accessing a pointer or is the _ptr suffix to indicate that this is variable is a pointer? If it's the latter, then it should be p_access instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line was copied and pasted from the SpvOpLoad..SpvOpImageTexelPointer case below (see line 1204). I can change it on this line, but perhaps it's better to fix both lines at once in a separate PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, apologies I didn't see that. You're right, that should be handled in a separate PR, not critical.

@@ -101,7 +101,7 @@ all_descriptor_bindings:
accessed: 1
uav_counter_id: 4294967295
uav_counter_binding:
ByteAddressBuffer offsets: [4, 5, 11, 13]
ByteAddressBuffer offsets: [13, 5, 11, 4]
Copy link
Contributor

Choose a reason for hiding this comment

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

little concerned why this was flipped here, but not in user_type/byte_address_buffer_3.spv.yaml

Copy link
Contributor

Choose a reason for hiding this comment

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

less concern because the order wasn't important/required

@spencer-lunarg spencer-lunarg merged commit f368a83 into KhronosGroup:main Jul 12, 2024
5 checks passed
@daniel-story daniel-story deleted the function-parameter-liveness branch July 16, 2024 02:12
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.

Bindings missing from reflection data if passed by parameter
4 participants