Materials: each constant's type from the shader tables; integers written as integers #183
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!183
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/183/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@holdmysocks on GitHub · 2026-11-24 17:14 UTC · original
holdmysocks:claude/param-types→master· +145 −20 · 5 files · 3 commits · merged 2026-11-24 17:36 UTCWhat
A material constant's descriptor in a drawable gives its size and place but not its type, so integer parameters were printed as floats (a value such as 4785 came out as a tiny float). The type is now joined from the shader archive's own tables (#147).
shaderfx::ParamIndex: per effect, each material constant's type code and shader-variable hash, by parameter hash. Built fromshaders.rpfon first use (about 2 s) and kept in<work>/index/shader_params.json; rebuilt when the archive is newer.typeon each entry ofdrawable.shaders[].constants(floattofloat4,int,int3...).materials.jsonand the four-layermultilayer.paramswrite integer types as the integers their bits hold.Type codes
Checked on real materials (two archives, about 1.1 million values): code 0x01 is zero or a small integer in all of about 20,000 values and never float-looking; code 0x03 always takes three components and holds byte patterns; 0x09 to 0x0c are float to float4. 0x02 and 0x04 are named
int2andint4by that pattern only. Other codes staytype_xxand are written as unsigned integers.Checked
float, 32float4, 1int), and the integer one reads 4785 inmodel.json,materials.jsonand the four-layer parameters.cargo test -p sixng-core: 178 passed (new tests for the index, the type names and the typed output).Not done
shaders.rpfonce to build the index; if the archive is missing, constants simply keep no type.