Added more shader instructions, including BFE, BRA (partial), FMNMX, ISCADD, SHL, LD_C, some shader related fixes, added support for texture component selection
This commit is contained in:
parent
9b9ead94cd
commit
b19c474082
28 changed files with 806 additions and 118 deletions
|
@ -87,10 +87,10 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
|
||||
public void Create(long Tag, GalShaderType Type, byte[] Data)
|
||||
{
|
||||
Stages.GetOrAdd(Tag, (Key) => ShaderStageFactory(Type, Data));
|
||||
Stages.GetOrAdd(Tag, (Key) => ShaderStageFactory(Type, Tag, Data));
|
||||
}
|
||||
|
||||
private ShaderStage ShaderStageFactory(GalShaderType Type, byte[] Data)
|
||||
private ShaderStage ShaderStageFactory(GalShaderType Type, long Tag, byte[] Data)
|
||||
{
|
||||
GlslProgram Program = GetGlslProgram(Data, Type);
|
||||
|
||||
|
@ -140,11 +140,21 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
{
|
||||
foreach (ShaderDeclInfo DeclInfo in Stage.UniformUsage.Where(x => x.Cbuf == Cbuf))
|
||||
{
|
||||
float Value = BitConverter.ToSingle(Data, DeclInfo.Index * 4);
|
||||
|
||||
int Location = GL.GetUniformLocation(CurrentProgramHandle, DeclInfo.Name);
|
||||
|
||||
GL.Uniform1(Location, Value);
|
||||
int Count = Data.Length >> 2;
|
||||
|
||||
//The Index is the index of the last element,
|
||||
//so we can add 1 to get the uniform array size.
|
||||
Count = Math.Min(Count, DeclInfo.Index + 1);
|
||||
|
||||
unsafe
|
||||
{
|
||||
fixed (byte* Ptr = Data)
|
||||
{
|
||||
GL.Uniform1(Location, Count, (float*)Ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue