Skip to content

Update SceneObject to allow binding to a named output #298

Description

@pramsey1234

scene_rdl2: lib/scene/rdl2/SceneObject.{h,cc} need to allow binding of an attribute to a particular output on a shader object.

Some Implementation Thoughts

  • add setBinding version which takes an output name
  • getBinding needs to also return the output key or name
    Should there still be a way to get the binding without accepting a name for backward compatibility?
    If so, what should happen if an old getBinding is called on a binding which isn't the only output and isn't the default output (if there is a default)?
  • add an an array of output name or key to match mBindings array (one entry per attributes index)

List of Possible Functions

template <typename T> void setBinding(AttributeKey<T> key,
                                      SceneObject* sceneObject, ShaderOutputKey<T> outKey);
void setBinding(const Attribute& attr, SceneObject* sceneObject, ShaderOutput& output);
void setBinding(const std::string& name, SceneObject* sceneObject, const std::string& outName);
template <typename T, typename U> SceneObject* SceneObject::getBinding(AttributeKey<T> key,
                                                                       ShaderOutputKey<U>& outputKey) const;
SceneObject* SceneObject::getBinding(const Attribute& attr, ShaderOutput& output) const;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions