public struct VfxShaderUniformsThe push-constant block VfxShaderEmitter declares, as the host writes it.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Why this is a struct and not a set of arguments. The emitted shader opens with five push constants in a fixed order, and a push-constant block is laid out by that order. Something has to know it in order to fill the bytes, and the choice is between a host that spells the offsets out by hand and a declaration sitting next to the emitter that writes them. This is the second one: the field order here is the declaration order there, and the two are one file apart rather than one assembly apart.
It is checked rather than trusted. The layout rule is std430's and the compiler applies it, so agreement is a claim about two pieces of code and not something a comment can secure. VfxGpuLayoutTests compiles the emitted source and compares the reflected offsets to these ones, member by member — which is why the fields are ordinary and public rather than packed cleverly.
Eight scalars, each four bytes, each four-byte aligned: Size is thirty-two and there is no padding anywhere in it. That is one reason to prefer scalars here over, say, a float4 of packed parameters — the packed one would be the version with a layout rule worth getting wrong.
⚠ Which is also why the origin is three floats and not a float3. std430 aligns a three-component vector to sixteen bytes, so one here would pad the block after Time and again at its own tail — turning a layout with no rule in it into one with two. Well inside the hundred and twenty-eight bytes of push constants every Vulkan device guarantees either way.
Fields and properties (10)
public const int SizeHow big the block is, in bytes, under std430.
public float DeltaTimeThe step, in seconds. Zero for an initializer dispatch.
public uint SeedThe system instance's seed.
public int FirstThe first particle the dispatch touches.
public int ParticleCountHow many it touches.
public float TimeHow long the system has been running, in seconds.
public float OriginXWhere the emitter is, x. Added to every position an initializer writes.
public float OriginYWhere the emitter is, y.
public float OriginZWhere the emitter is, z.
public Vector3 OriginThe three as a vector, and a block carrying one.
Used by (2)
- VfxGpuSimulationVixen.Rendering
- VfxShaderUniformTestsVixen.Vfx.Tests