-
Notifications
You must be signed in to change notification settings - Fork 151
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
Add AccessedVariable struct and logic #238
Add AccessedVariable struct and logic #238
Conversation
} break; | ||
case SpvOpCopyMemory: | ||
case SpvOpCopyMemorySized: { | ||
CHECKED_READU32(p_parser, p_node->word_offset + 2, p_func->accessed_ptrs[p_func->accessed_ptr_count]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a test for OpCopyMemory
.. we were off by 1 as the Target and Source operand are 1
and 2
SpvReflectDescriptorBinding* p_binding = &p_module->descriptor_bindings[i]; | ||
for (uint32_t j = 0; j < used_acessed_count; j++) { | ||
if (used_accesses[j].variable_ptr == p_binding->spirv_id) { | ||
p_binding->accessed = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the goal here is we can find all the accesses pointing to this descriptor binding variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Just some nits with formatting and var names. Not crucial but would be cool to have those changes before merge.
@@ -270,23 +290,24 @@ static bool SearchSortedUint32(const uint32_t* arr, size_t size, uint32_t target | |||
return false; | |||
} | |||
|
|||
static SpvReflectResult IntersectSortedUint32(const uint32_t* p_arr0, size_t arr0_size, const uint32_t* p_arr1, size_t arr1_size, | |||
uint32_t** pp_res, size_t* res_size) { | |||
static SpvReflectResult IntersectSortedAccessedVariable(const SpvReflectPrvAccessedVariable* p_arr0, size_t arr0_size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be one param per line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we would need to set BinPackParameters
in the .clang-format
file
for both #224 and #226 there is a need to get the underlying mapping between an access (ex
OpLoad
) and theOpVariable
it touchedCurrently we just tracked the
uint32_t
in order to sett theaccessed
booleanThis creates the ground work the for
SpvReflectPrvAccessedVariable
to store this logic