-
Notifications
You must be signed in to change notification settings - Fork 12
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
When is a block not a block? #83
Comments
thx for your attention first of all, lol. Well, For a simplest example, try compiling the following two shaders with // non-block.comp
#version 460 core
struct A { int i; };
void main() {
A a;
a.i = 0;
}
// block.comp
#version 460 core
layout(binding=0) buffer A { int i; } a;
void main() {
a.i = 0;
} And you will find out that there is no We certainly can record the pointer types with their storage classes attached, but it feels unnecessary to me because SPIR-Q doesn't actually care about what it points to. It's simply a pointer to somewhere. If its a known type; inline it. If the pointer's |
Also SPIR-Q doesn't map every types SPIR-V provides, it only strictly reflect the types that might be interesting to the shader users. |
Point taken. I'm dragging myself through understanding the spec, so I still equivocate. I've done some work to show what I mean, consider this arrangement:
The current library produces This makes sense to me because ForwardPointer types must have regular Pointer types attached to them before they are used, so you may as well propagate them. |
It's not perfect, since the linked-list case from e.g. https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_buffer_reference.txt |
I think I get your point here. I had the same concern implementing this feature but in the end I decided not to do so because it adds an extra pass to transform all The decision was made based on the fact that our |
Sounds good. If it's any help when thinking of that part, either for inspiration or "what not to do," I got what I wanted by changing the box to That way the real pointer can update the forward pointer when we find out what it is. On the other hand, it leaves the recursion problem for self-referential structs. |
I was writing up an issue for OpForwardPointer... but you literally fixed it in that period 🥇
It's taken me a while to get my head around my question, so maybe this one's been resolved also 😄
So, this is more of a use-question:
If you are using EXT_buffer_reference, reference-bound buffers are decorated as Block type. If the block is used, there is a pointer declared for that type. So, if this library were intended to map these types, it would seem like the place to do it is in
populate_one_ty
when Pointer types are captured: see if the pointer is to a Block decorated type withPhysicalStorageBuffer
as the storage class.Ok, but I can argue to myself that Block types are not Descriptors (because they aren't) or any of the other Variable types. Should there be a
Variable::Block
variant?I need this feature, so I'm going to try to work it out, but I'd rather not trip up any of the overall design if this is something you think this lib needs also. So, I'd love to hear what you think of this.
I titled this issue so that it was clear this is more of a "discuss" issue, but also because I wanted to make sure that Block decorated types which have pointers to them only occur when you're using reference buffers.
Thanks for your hard work on this useful project!
Edit: I have since answered my own silly question, as it's Block types with PhysicalStorageBuffer storage classes that exactly describe what's being captured here, although there may be other possible configurations.
The text was updated successfully, but these errors were encountered: