Shader.cs - Validation will only call GL validate program when in debug configuration

This commit is contained in:
miku-666
2024-02-05 18:49:38 +01:00
parent 1e06b51d50
commit 8ec68ddeb7
2 changed files with 4 additions and 1 deletions

View File

@@ -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)

View File

@@ -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();
}
}
}