Skip to content

update ispc_dso_generate to handle multi-output shaders #301

Open

Description

@pramsey1234

Update cmake_modules/build_scripts/ispc_dso_generate

  • declare the outputs on the SceneClass
  • Provide a structure for multi-output shaders use for returning results

Some Implementation Thoughts

  • Accept shader json files having multiple named and typed outputs
  • declare the outputs in the attributes.cc file using the new SceneClass functions
    For each output add a line to attribute.cc - sceneClass.declareAttribute<{typename}>("{name}", {uniformity})
  • define structs in attributes.cc and attributes.isph which include all of the outputs in the order defined in the json file
    For multi-output shaders declare a structure named "{shadername}_return_data" in attributes.cc with a member for each output of the appropriate type. (Bool, Int, Float, Vec2g, Vec3f, Vec4f, Color, Rgba, Mat3f, or Mat4f).

In the process of naming other things in this project it seems apparent that the existing "outputAttributes" record in the shader json files is probably misnamed and should just be something like "outputs". During transition it might be a good idea to recognize either "output" or "outputAttributes" as the list of output attributes.

Activity

  1. converted this from a draft issue on Sep 23, 2026
  2. pramsey1234 commented on Sep 23, 2026

    @pramsey1234
    Author

    I'm imagining the json file for ND_separate3_color3 would be something like:

    {
    	"attributes" : 
    	{
    		"inAttr" : 
    		{
    			"default" : "Rgb(0.0f, 0.0f, 0.0f)",
    			"flags" : "FLAGS_BINDABLE",
    			"name" : "in",
    			"type" : "Rgb"
    		}
    	},
        "outputs" :
         {
             "outrAttr" :
             {
                 "name" : "outr",
                 "type" : "Float"
             },
             "outgAttr" :
             {
                 "name" : "outg",
                 "type" : "Float"
             },
             "outbAttr" :
             {
                 "name" : "outb",
                 "type" : "Float"
             }
         },
    	"name" : "ND_separate3_color3",
    	"type" : "Map"
    }
    
  3. moved this from Ready to In progress in Multi-output shaderson Oct 12, 2026
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