From 8ec68ddeb788675113398b3cd29a12a5ef11d30e Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 5 Feb 2024 18:49:38 +0100 Subject: [PATCH] Shader.cs - Validation will only call GL validate program when in debug configuration --- PCK-Studio/Rendering/Shader.cs | 4 ++++ PCK-Studio/Rendering/Texture/CubeTexture.cs | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/Rendering/Shader.cs b/PCK-Studio/Rendering/Shader.cs index 8a542cc6..67f2f613 100644 --- a/PCK-Studio/Rendering/Shader.cs +++ b/PCK-Studio/Rendering/Shader.cs @@ -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) diff --git a/PCK-Studio/Rendering/Texture/CubeTexture.cs b/PCK-Studio/Rendering/Texture/CubeTexture.cs index 50cda69b..2f5acadb 100644 --- a/PCK-Studio/Rendering/Texture/CubeTexture.cs +++ b/PCK-Studio/Rendering/Texture/CubeTexture.cs @@ -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(); } } }