Giter Club home page Giter Club logo

Comments (2)

aclysma avatar aclysma commented on July 17, 2024 1

#242 should address all three issues I mentioned in my previous comment

from rafx.

aclysma avatar aclysma commented on July 17, 2024

I'm going to look at and think about this more, but what's happening is that we have two kinds of render graph nodes - "render" and "callback". Callback is usually compute operations but there's no reason one couldn't do other GPU operations, so I use the more general naming of a "callback" node because it's literally just giving you a callback. The way the render graph code knows which type of node you want is based on if you called set_renderpass_callback or set_callback. If you don't call either, it defaults to just a callback (i.e. no renderpass is created.)

At a code level, we're checking image states as we progress through nodes to determine where barriers need to be placed. Most of the time, we visit a node and look at all the transitions needed to do the work before the node performs work. The exception is output images - their transition is after all nodes are visited. So that case is a different (older) codepath. Right now it only handles image attachments, which should only ever be placed on renderpasses. So the code is reasonably skipped for non-renderpasses.

So some things to resolve:

  • A node with an image attachment only makes sense as a renderpass, but the API design where no callback set = no renderpass unintuitively opts out of creating the renderpass. So may need to rethink this. I don't think we should implicitly do a renderpass based on there being an attachment or not. Other options:
    • Change add_node to be add_renderpass_node and add_callback_node
    • Change add_node to take an enum that specifies what kind of node to create
  • Should probably have better error messaging if an image attachment is used on a non-renderpass node as it's always wrong.
  • Handling barriers for output images/buffers seems broken for anything but attachment images. The current form of this code is relatively unchanged since the first implementation of the render graph which was extremely limited, basically only supporting renderpasses. So the end of build_pass_barriers needs a proper implementation, and it probably needs to be done as a final pass on the graph as a whole rather than tacked onto the end of whatever node last touched the resource.

A potential bandaid would be to fail loudly if no callback is provided, and probably also fail loudly if a color attachment is used with a node that's not a renderpass. This would make it more obvious that the graph in this repro is not legal (because under current API design it describes using a color attachment without a renderpass.)

from rafx.

Related Issues (20)

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.