Giter Site home page Giter Site logo

Comments (7)

Tobski avatar Tobski commented on May 24, 2024 1

I think the issue is that the layout transition only makes the memory available and not visible?

Yes, the issue is that writes are only supposed to need previous writes available to avoid a data race. However, it seems the spec has been a bit loose on this, and VVL (and my example code) disagrees with what we'd intended. I've raised a spec bug against this internally and we'll see where we land with it... going to have to put a pin in this until that is sorted, because I don't want to change it and then revert it.

(Btw thank you for raising this, it's something I wish we had caught sooner!)

from simple_vulkan_synchronization.

Tobski avatar Tobski commented on May 24, 2024

Hi @jkoenen, while a layout transition might actually perform a write in reality, from the spec POV it does not. If an implementation does access an image as part of a layout transition, it is responsible for doing any required cache flushes - the user does not have to do anything, which is why no access masks are specified. There's no issue with the code here.

The example you've quoted does the same as this test is expecting.

from simple_vulkan_synchronization.

jkoenen avatar jkoenen commented on May 24, 2024

I'm not sure I follow - I did get a validation error with your code and in the example the dstAccessMask is VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT instead of 0)

from simple_vulkan_synchronization.

Tobski avatar Tobski commented on May 24, 2024

Oh my apologies, I misread the example - been too long since I've looked at this clearly 😬

Let me take another look at this..

from simple_vulkan_synchronization.

Tobski avatar Tobski commented on May 24, 2024

Okay now I'm very confused. I disagree with the comments I made in the examples (I wrote those too!).

So two things - firstly, as a rule of thumb, you only need write access flags in the source and read access flags in the destination - write access in the destination is more or less meaningless, so I'm kind of confused as to why I suggested otherwise.
Secondly, layout transitions do behave as I stated in my first comment:

Available memory is automatically made visible to a layout transition, and writes performed by a layout transition are automatically made available.

(From the spec under "Image Layout Transitions").

So as far as I can tell, the example and the validation layer are both wrong here. The 2:1 ratio would make me doubt that usually, but given validation used the examples as source documentation I'm not putting too much stock in it 🙃

Could you raise an issue against the validation layers with details of what you're doing? I'll leave this open until we resolve it...

I'll also sort out the sync examples once we figure this out, so no need to raise a separate issue for that.

from simple_vulkan_synchronization.

Tobski avatar Tobski commented on May 24, 2024

Ack, hold up, this problem might run deeper than I thought, don't raise a validation issue yet (If you have nearly written it out feel free to post it though) - but I may need to go get some clarification on the spec here...

from simple_vulkan_synchronization.

jkoenen avatar jkoenen commented on May 24, 2024

This section in the spec is probably relevant:

Applications must ensure that layout transitions happen-after all operations accessing the image with the old layout, and happen-before any operations that will access the image with the new layout. Layout transitions are potentially read/write operations, so not defining appropriate memory dependencies to guarantee this will result in a data race.

I think the issue is that the layout transition only makes the memory available and not visible?

from simple_vulkan_synchronization.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.