update ispc_dso_generate to handle multi-output shaders

Open
#301 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cmake
Domain
build-system

Research direction

Start with cmake_modules/build_scripts/ispc_dso_generate and inspect the shader JSON files that define outputAttributes; trace how generated declarations are used in attributes.cc and attributes.isph. Support multiple named, typed outputs and define the return structure in JSON order, while accepting both output and outputAttributes during transition. Done when generated SceneClass attributes and return structures cover multi-output shaders.

Written by the indexing model from the issue text.

Description

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.

Dominant language
CMake
Stars
4.7k
Forks
321
Avg merge
13m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenMoonRay/openmoonray

All issues in OpenMoonRay/openmoonray

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.