/// Use the given storage buffer as a writable shader resource
Use the given storage buffer as a writable shader resource
Use the given storage buffer as a writable shader resource
pub fn modify_storage_buffer(
        &mut self,
        node: RenderGraphNodeId,
        buffer: RenderGraphBufferUsageId,
        mut constraint: RenderGraphBufferConstraint,
        load_op: RafxLoadOp,
    ) -> RenderGraphBufferUsageId {
        constraint.resource_type |= RafxResourceType::BUFFER_READ_WRITE;
        match load_op {
            // Don't clear the buffer
            RafxLoadOp::DontCare | RafxLoadOp::Load => {
                let (read_buffer, write_buffer) = self.add_buffer_modify(node, buffer, constraint);
                self.node_mut(node)
                    .storage_buffer_modifies
                    .push(read_buffer);
                write_buffer
            }
            RafxLoadOp::Clear => {
                // Add a node to clear the buffer
                let clear_node =
                    self.add_node("modify_storage_buffer_clear", self.node(node).queue);
                let (cleared_buffer_read, cleared_buffer_write) =
                    self.add_buffer_modify(clear_node, buffer, constraint);
                self.node_mut(clear_node)
                    .storage_buffer_modifies
                    .push(cleared_buffer_read);
                self.setup_buffer_clear_callback(clear_node, cleared_buffer_write);
                let (read_usage, write_usage) =
                    self.add_buffer_modify(node, cleared_buffer_write, Default::default());
                self.node_mut(node).storage_buffer_modifies.push(read_usage);
                write_usage
            }
        }
    }
pub fn modify_storage_buffer ( & mut self , node : RenderGraphNodeId , buffer : RenderGraphBufferUsageId , mut constraint : RenderGraphBufferConstraint , load_op : RafxLoadOp , ) -> RenderGraphBufferUsageId { constraint . resource_type |= RafxResourceType :: BUFFER_READ_WRITE ; match load_op { // Don't clear the buffer RafxLoadOp :: DontCare | RafxLoadOp :: Load => { let ( read_buffer , write_buffer ) = self . add_buffer_modify ( node , buffer , constraint ) ; self . node_mut ( node ) . storage_buffer_modifies . push ( read_buffer ) ; write_buffer } RafxLoadOp :: Clear => { // Add a node to clear the buffer let clear_node = self . add_node ( " " , self . node ( node ) . queue ) ; let ( cleared_buffer_read , cleared_buffer_write ) = self . add_buffer_modify ( clear_node , buffer , constraint ) ; self . node_mut ( clear_node ) . storage_buffer_modifies . push ( cleared_buffer_read ) ; self . setup_buffer_clear_callback ( clear_node , cleared_buffer_write ) ; let ( read_usage , write_usage ) = self . add_buffer_modify ( node , cleared_buffer_write , Default :: default ( ) ) ; self . node_mut ( node ) . storage_buffer_modifies . push ( read_usage ) ; write_usage } } }
Use the given storage buffer as a writable shader resource
Use the given storage buffer as a writable shader resource
&mut self
node
RenderGraphNodeId
buffer
RenderGraphBufferUsageId
constraint
RenderGraphBufferConstraint
load_op
RafxLoadOp