-
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 Access Flags for DescriptorBinding #224
base: main
Are you sure you want to change the base?
Add Access Flags for DescriptorBinding #224
Conversation
0a9a11a
to
62309a3
Compare
@@ -115,6 +115,7 @@ all_descriptor_bindings: | |||
block: *bv2 # | |||
array: { dims_count: 0, dims: [] } | |||
accessed: 1 | |||
access_flags: 0x00000000 # NONE |
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.
last thing left in PR is figure out why this is not consistent with accessed
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 is
%13 = OpAccessChain %_ptr_StorageBuffer__struct_3 %2
%14 = OpArrayLength %uint %13 1
OpReturn
OpFunctionEn
and from looking at spec, this is not considered a read
, just an access
@@ -316,6 +317,7 @@ all_descriptor_bindings: | |||
block: *bv7 # "" | |||
array: { dims_count: 0, dims: [] } | |||
accessed: 1 | |||
access_flags: 0x00000000 # NONE |
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.
seems
OpStore -> OpAccessChain -> OpAccessChain -> OpVariable
is a valid thing... need to fix
SPV_REFLECT_ACCESS_READ = 0x00000001, | ||
SPV_REFLECT_ACCESS_WRITE = 0x00000002, | ||
// Atomic will always also be marked as READ and WRITE | ||
SPV_REFLECT_ACCESS_ATOMIC = 0x00000004, |
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.
Is there ever a case where ATOMIC is used or checked by itself it it always inlcudes READ and WRITE? Wondering if there's a different way to express this.
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.
so I had it before as separate... #222 (comment) convinced me otherwise
closes #222
The logic uses the same pattern as we do to detect
accessed
boolean but expands the logic to look up one more instruction to see what type it wasExample: if we have the instructions
OpImageRead -> OpLoad -> OpVariable
, before we just tracked theOpLoad
touched theOpVariable
and marked asaccessed
now we track this
OpLoad
as aSpvReflectPrvAccessedVariable
and we know both theOpVariable
it points to, but now also track the Result ID so theOpImageRead
can find thisOpLoad
I wrote the code to be consistent with the current code, which I think could be cleaned up to be easier to read/maintain, but would like to do that as a separate PR