Bug 42164 - OpenTK-1.0 not logging shader compilation errors correctly
Summary: OpenTK-1.0 not logging shader compilation errors correctly
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2016-06-24 20:52 UTC by Rishub
Modified: 2016-06-28 15:29 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Rishub 2016-06-24 20:52:19 UTC
The code below was compiled with OpenTK-1.0.dll (version 1.0.0.0)

protected override void OnLoad (EventArgs e)
		{
			
			base.OnLoad (e);

			viewportHeight = Height; viewportWidth = Width;

			
			string vertexShaderSrc =  "attribute vec4 vPosition    \n" + 
							  "void main()                  \n" +
							  "{                            \n" +
							  "   gl_Position = vPosition;  \n" +
							  "}                            \n";
                                    \n";

            int shader = GL.CreateShader(ShaderType.VertexShader);
            GL.ShaderSource(shader, 1, new string[] { vertexShaderSrc }, (int[])null);
            GL.CompileShader(shader);
            int compiled = 0;
            GL.GetShader(shader, ShaderParameter.CompileStatus, out compiled);
            Log.Debug("VIEW", ""+compiled);
            int length = 0;
            GL.GetShader(shader, ShaderParameter.ShaderType, out length);
            Log.Debug("VIEW", "" + compiled + " " + length);
            var log = new StringBuilder(length);
            Log.Debug("VIEW",GL.GetShaderInfoLog(shader));


}

The above shader string has an error in it (vPosition should have a semicolon) - However, GetShaderInfoLog is empty implying it passed. The length of the log is also zero.  

When I remake the same code and compile with OpenTK.dll (version 0.9.9.3), the shader compilation fails and returns the expected error string. 

Is there something I am doing incorrectly? Or is this a bug with OpenTK-1.0.dll
Comment 1 Rishub 2016-06-28 15:29:31 UTC
Solved

I forgot to set ContextRenderingApi inside OnCreateFrameBuffer()