Change shader traits to handle ID enums instead of integers #488
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the breaking change half of #484, where all shader traits pass IDs as their
open_enum
types (technically structs) instead of as integers.open_enum
allows custom IDs to be added by the consuming program, as seen in the firework, logo, and Mandelbrot examples.I noticed that while changing the original reserved ID comments on
Effect
that it recommended using the IDs above the internal range instead of below the internal range. I suspect that is due to how materials and effects share the same ID space. If that system is desired to be kept, the documentation ofEffectMaterialId
will need updated accordingly. Otherwise, it might be good to compress the ID usage of the built-in effects to all be above0x8000
, leaving the lower half of the ID range for public use similar to the other two ID types.