Skip to content

Kernel extensions

Steven Johnson edited this page Feb 13, 2019 · 23 revisions

Rough outline of other possibilities in kernel declaration:

wantsUniformVectors = true, resolveUniformVectorCount = true,

for uniform arrays,

isReleasable = true,

for shaders that need not persist (should not outright remove them since they might be in use), mainly throwing a bone to shader editors,

fillSamplerType1 = "cubemap", fillSamplerType2 = "volume",

for sampler types,

requires = { requires = "other", snippet = [[blah]] },

for incorporating pre-registered snippets (ideally with redundancy checks and topological sorting),

fragmentPrelude = [[blah]], vertexPrelude = [[blah]],

to set anything up for the *requires or kernel (maybe something for varyings too),

isUnit = true,

or canTakeSprite maybe, to improve how effects are applied to sprites,

isImmediate = true,

to not defer loading,

onActivate = Begin, onDeactivate = End,

for pre- and post-binding logic. (These would more or less have to be command-like because of when they happen, so probably following some policies such as described here. This might be too much trouble. Actually, I'm now thinking some sort of "state" instruction set would be a good common ground.)

Some instancing stuff would go here too. Anything else?

(Compute kernels might be a parallel but similar thing?)

Many of these would produce a "shader state" object used to effect these operations, obtainable from some graphics API for example.


Priority-wise, this is mixed, but I think at the moment everything is related to another idea anyhow.