-
Notifications
You must be signed in to change notification settings - Fork 147
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
Reflecting capabilities used by a shader more finely #222
Comments
will currently show
but I can see how having a "type of access" flag to list if it was atomic could be helpful Seems like something I could take a crack at |
That would be amazing. A related request is this: |
Thanks! This looks great. Seems to work with a simple test case. Offhand I would expect the READ/WRITE flags to also be set when ATOMIC is set though. It allows for logic that is just looking if a resource is read or written to handle those flags regardless of if the operation happens to be atomic or not |
I wasn't 100% if it made sense to have it do that or not... I think you are right and would be easier to just have to check for |
I finally had some time to look at #224 . I wanted to get a better understanding of what the purpose of the READ/WRITE flags are? If the the READ/WRITE flag is to indicate if a descriptor binding is READ_ONLY or READ_WRITE, then having |
something else worth noting from my PR, something like %ac = OpAccessChain %ptr %index
%14 = OpArrayLength %uint %ac 1 I am not sure if this is actually a "read" (seems it isn't from the spec) but currently this is marked as "accessed" edit: this is a bug, |
@chaoticbob The purpose is to determine how a resource is actually used in the shader, rather than just using how it's declared. There may be code that writes to a READ_WRITE resource, however due to optimization it ends up getting removed in one compilation, thus the resource is only actually READ, and code that is using reflection to determine synchronization can optimize based on that more refined knowledge. |
If I'm given an arbitrary shader and I want to see if it runs on the local hardware, I can use reflection to see if any capabilities are being requested that the hardware doesn't support. However this isn't quite fine grained enough in many cases. For example if SpvCapabilityAtomicFloat32AddEXT is declared, I can see if
VK_EXT_shader_atomic_float
is supported as a first check. However the hardware may support atomic float operations on some data types and not others, as per the entries inVkPhysicalDeviceShaderAtomicFloatFeaturesEXT
. For example on macOSshaderImageFloat32AtomicAdd
is not currently supported.Is there any path forward where we can see what kinds of operations are applied to data, such as flags on a reflected image descriptor saying it was used for an atomic float operation?
The text was updated successfully, but these errors were encountered: