daily update on 20240209 by nitload youmu
This commit is contained in:
@@ -11,21 +11,17 @@ namespace StgSharp.Graphics
|
||||
|
||||
public class Uniform<T> where T : struct
|
||||
{
|
||||
internal int id;
|
||||
internal glSHandle id;
|
||||
private IglFunc GL;
|
||||
|
||||
internal unsafe Uniform(
|
||||
uint shaderID, string name, IglFunc gL)
|
||||
ShaderProgram program, string name, IglFunc gl)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
GL = gL;
|
||||
fixed (byte* ptr = namearray)
|
||||
{
|
||||
id = GL.GetUniformLocation(shaderID, ptr);
|
||||
}
|
||||
GL = gl;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal unsafe Uniform(int id)
|
||||
internal unsafe Uniform(glSHandle id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
@@ -37,21 +33,17 @@ namespace StgSharp.Graphics
|
||||
where T : struct
|
||||
where U : struct
|
||||
{
|
||||
internal int id;
|
||||
internal glSHandle id;
|
||||
private IglFunc GL;
|
||||
|
||||
internal unsafe Uniform(
|
||||
Shader program, string name, IglFunc glFunc)
|
||||
ShaderProgram program, string name, IglFunc gl)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
GL = glFunc;
|
||||
fixed (byte* ptr = namearray)
|
||||
{
|
||||
id = GL.GetUniformLocation(program.programID, ptr);
|
||||
}
|
||||
GL = gl;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal unsafe Uniform(int id)
|
||||
internal unsafe Uniform(glSHandle id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
@@ -62,20 +54,16 @@ namespace StgSharp.Graphics
|
||||
where U : struct
|
||||
where V : struct
|
||||
{
|
||||
internal int id;
|
||||
internal glSHandle id;
|
||||
private IglFunc GL;
|
||||
|
||||
public unsafe Uniform(Shader program, string name, IglFunc glFunc)
|
||||
public unsafe Uniform(ShaderProgram program, string name, IglFunc gl)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
GL = glFunc;
|
||||
fixed (byte* ptr = namearray)
|
||||
{
|
||||
id = GL.GetUniformLocation(program.programID, ptr);
|
||||
}
|
||||
GL = gl;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal unsafe Uniform(int id)
|
||||
internal unsafe Uniform(glSHandle id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
@@ -87,20 +75,16 @@ namespace StgSharp.Graphics
|
||||
where V : struct
|
||||
where W : struct
|
||||
{
|
||||
internal int id;
|
||||
internal glSHandle id;
|
||||
private IglFunc GL;
|
||||
|
||||
internal unsafe Uniform(Shader program, string name, IglFunc glFunc)
|
||||
internal unsafe Uniform(ShaderProgram program, string name, IglFunc gl)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
fixed (byte* ptr = namearray)
|
||||
{
|
||||
id = GL.GetUniformLocation(program.programID, ptr);
|
||||
}
|
||||
GL = glFunc;
|
||||
GL = gl;
|
||||
id = GL.GetUniformLocation(program.handle, name);
|
||||
}
|
||||
|
||||
internal unsafe Uniform(int id)
|
||||
internal unsafe Uniform(glSHandle id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
@@ -113,48 +97,56 @@ namespace StgSharp.Graphics
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float> uniform, float v0)
|
||||
{
|
||||
api->glUniform1f(uniform.id, v0);
|
||||
api->glUniform1f(uniform.id.DirectValue, v0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<int> uniform, int i0)
|
||||
{
|
||||
api->glUniform1i(uniform.id, i0);
|
||||
api->glUniform1i(uniform.id.DirectValue, i0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
{
|
||||
api->glUniform2f(uniform.id, v0, v1);
|
||||
api->glUniform2f(uniform.id.DirectValue, v0, v1);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
{
|
||||
api->glUniform3f(uniform.id, v0, v1, v2);
|
||||
api->glUniform3f(uniform.id.DirectValue, v0, v1, v2);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
{
|
||||
api->glUniform4f(uniform.id, v0, v1, v2, v3);
|
||||
api->glUniform4f(uniform.id.DirectValue, v0, v1, v2, v3);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetValue(Uniform<float, float, float, float> uniform, Vec4d vec)
|
||||
{
|
||||
api->glUniform1fv(uniform.id, 4, &vec);
|
||||
api->glUniform1fv(uniform.id.DirectValue, 4, &vec);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetValue(Uniform<Vec4d> uniform, Vec4d vec)
|
||||
{
|
||||
api->glUniform1fv(uniform.id, 4, &vec);
|
||||
api->glUniform1fv(uniform.id.DirectValue, 4, &vec);
|
||||
}
|
||||
}
|
||||
|
||||
internal partial class GLonUpdate
|
||||
internal unsafe partial class GLonUpdate
|
||||
{
|
||||
private IntPtr UniformVal3fPtr = (IntPtr)(delegate*<void>)&UniformVal3f;
|
||||
//TODO xontinue here
|
||||
private static void UniformVal3f()
|
||||
{
|
||||
|
||||
paramQueue.
|
||||
}
|
||||
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
{
|
||||
glActionQueue.Enqueue(
|
||||
|
||||
Reference in New Issue
Block a user