mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-11 02:22:14 +00:00
Shader.cs - Validation will only call GL validate program when in debug configuration
This commit is contained in:
@@ -114,12 +114,16 @@ namespace PckStudio.Rendering
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
#if DEBUG
|
||||
GL.ValidateProgram(_programId);
|
||||
GL.GetProgram(_programId, GetProgramParameterName.ValidateStatus, out int status);
|
||||
bool success = status != 0;
|
||||
if (!success)
|
||||
Debug.WriteLine(GL.GetProgramInfoLog(_programId), category: nameof(Shader));
|
||||
return success;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
public static Shader Create(params ShaderSource[] shaderSources)
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace PckStudio.Rendering.Texture
|
||||
BitmapData data = texture.LockBits(new Rectangle(Point.Empty, texture.Size), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||
GL.TexImage2D(TextureTarget.TextureCubeMapPositiveX + i, 0, PixelInternalFormat.Rgb8, widthPerFace, heightPerFace, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
||||
}
|
||||
Unbind();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user