Exemplo n.º 1
0
 private unsafe void UpdateUniform <T>(int uniformIndex, ShaderParam <T> p) where T : unmanaged
 {
     fixed(T *data = p.Data)
     {
         platformProgram.SetUniform(uniformIndex, new IntPtr(data), p.Count);
     }
 }
Exemplo n.º 2
0
 private unsafe void SyncIntVector2(int location, ShaderParam <IntVector2> param)
 {
     fixed(IntVector2 *dataPtr = param.Data)
     {
         GL.Uniform2(location, param.Count, (int *)dataPtr);
         PlatformRenderer.CheckErrors();
     }
 }
Exemplo n.º 3
0
 private unsafe void SyncInt(int location, ShaderParam <int> param)
 {
     fixed(int *dataPtr = param.Data)
     {
         GL.Uniform1(location, param.Count, dataPtr);
         PlatformRenderer.CheckErrors();
     }
 }
Exemplo n.º 4
0
 private unsafe void SyncFloatMatrix4x4(int location, ShaderParam <Matrix44> param)
 {
     fixed(Matrix44 *dataPtr = param.Data)
     {
         GL.UniformMatrix4(location, param.Count, false, (float *)dataPtr);
         PlatformRenderer.CheckErrors();
     }
 }
Exemplo n.º 5
0
 private unsafe void SyncFloatVector4(int location, ShaderParam <Vector4> param)
 {
     fixed(Vector4 *dataPtr = param.Data)
     {
         GL.Uniform4(location, param.Count, (float *)dataPtr);
         PlatformRenderer.CheckErrors();
     }
 }
Exemplo n.º 6
0
 private ShaderParam<T> GetParameter<T>(ShaderParamKey<T> key, int capacity)
 {
     var p = Items[key.Index] as ShaderParam<T>;
     if (p == null || p.Data.Length < capacity) {
         p = new ShaderParam<T>(capacity) { Name = key.Name };
         Items[key.Index] = p;
     }
     return p;
 }