Example #1
0
 /// <summary>
 /// Set an array of ints.
 /// </summary>
 /// <param name="ints">The integers to set.</param>
 public void Set(int[] ints)
 {
     lastUpdate++;
     constantType = ShaderConstantType.Integer;
     values       = ints;
 }
Example #2
0
 /// <summary>
 /// Constructs a new <see cref="SpecializationConstant"/>.
 /// </summary>
 /// <param name="id">The constant variable ID, as defined in the <see cref="Shader"/>.</param>
 /// <param name="type">The type of data stored in this instance. Must be a scalar numeric type.</param>
 /// <param name="data">An 8-byte block storing the contents of the specialization value. This is treated as an untyped
 /// buffer and is interepreted according to <see cref="Type"/>.</param>
 public SpecializationConstant(uint id, ShaderConstantType type, ulong data)
 {
     ID   = id;
     Type = type;
     Data = data;
 }
Example #3
0
 /// <summary>
 /// Set an array of floats.
 /// </summary>
 /// <param name="floats">Floats to set.</param>
 public void Set(float[] floats)
 {
     lastUpdate++;
     constantType = ShaderConstantType.Float;
     values       = floats;
 }
 public static ShaderResourceDescription ConstantBuffer(string name, ShaderConstantType type) => new ShaderResourceDescription(name, type);