
TransformFeedback problem
Posted Tuesday, 17 November, 2009 - 16:12 by Shocker inNow I am trying for TransformFeedback .
I made a simple TF sample .
But this program causes an error at GL.LinkProgram probably because of "TransformFeedbackVaryings".
... GL.TransformFeedbackVaryings(program, 1, new string[] { "feedback" }, TransformFeedbackMode.SeparateAttribs); GL.LinkProgram(program); GL.GetProgramInfoLog(program, out info); GL.GetProgram(program, ProgramParameter.LinkStatus, out status_code); if (status_code != 1) { //Error /* Link info --------- error: Varying (named edback) specified but not present in the program object. */ throw new ApplicationException(info); } GL.UseProgram(program); ...
Try changing 2nd argument of TransformFeedback to '0', the error disappers .
But, in rendering step , result of queries was zero .
This means the program couldn't write vertices into buffer object .
Could anyone tell me what is wrong in my code or show me a correct sample ?
Thanks .
I write down my PC's environments below . This may lead the problem to solving early .
OS : Windows Vista Home Premium SP2
CPU : Core 2 Duo T7500 2.2GHz
Mem : PC2-5300 2GB
GPU : Geforce 8600M GT (GDDR3 256MB)
ForceWare 186.81 (supports OpenGL 3.0)
Everytime, sorry for my english .
| Attachment | Size |
|---|---|
| Form1.cs | 7.74 KB |


Comments
Re: TransformFeedback problem
It looks correct. Though, you don't need fragment shader as you disable the rasterizer.
This can be easily a driver bug.
ATI fixed their Catalyst to support TF properly only 1-2 months ago.
Try latest NV drivers (even beta ones).
Re: TransformFeedback problem
I have got an Nvidia card and tried this code . And got the same error with some encoding problem:
error: Varying (named ë edback) specified but not present in the program object.
Re: TransformFeedback problem
Which version of OpenTK are you using and what is your OS language settings for non-Unicode applications? (You can find this in "Control Panel" -> "Regional and Language Options", it should be the last tab).
Re: TransformFeedback problem
Thanks for replies .
I use OpenTK 0.9.9.3 and OS language settings for non-unicode applications is Japanese .
Fortunately, today NVIDIA released new Beta version driver 195.55 for Notebooks .
I install it and test problem again .
Unfortunately, I got same error .
Re: TransformFeedback problem
Thanks. I've tested this on my Linux laptop (Quadro NVS135M, 190.42 drivers, Mono 2.4.3 / english codepage) and the code does not fail at that point. Instead, it fails with an "InvalidOperation" OpenGL error in the first
GL.DrawArrayscall. Unfortunately, I don't have access to a windows machine with transform-feedback-capable drivers right now, so I cannot test in a configuration more similar to yours.This looks like a marshaling issue but the cause is not immediately obvious (it could be similar to #1332: 2byte character may causes a bug with GL.ShaderSource .).
Suggestion: try importing the function manually.
// Code was wrong, see below for corrected code.We need to find out what works, so we can add this to OpenTK.
Edit: Corrected code here, http://www.opentk.com/node/1389#comment-7477
Re: TransformFeedback problem
I have to add what is obvious for me but might not be the same for you:
TransformFeedback + OpenTK works correctly in my engine (the 'dude' demo uses it), at least on ATI Catalyst 9.9+.
So the problem is not with OpenTK, but with Nv drivers most probably.
Re: TransformFeedback problem
Indeed, but you have to take into account that string-related functions are affected by your regional settings. I'm not saying that this is the problem here (it could be, but that's for from certain at this point - hence the code in my previous post), but it has caused problems before so it's something to keep an eye out for.
Re: TransformFeedback problem
I'm sorry for reply is late .
Where should I add code which manually calls TF ?
I tried inserting declares of delegate and it's instance into class members .
I got an error "static qualifier is improper" .
So I removed static qualifier .
then I got another error which notices wrong in argument type .
I swap 1st and 2nd argument of "Marshal.GetDelegateForFunctionPointer" .
finally error disappered , but program crashed .
Would you mind my asking you to tell me where is correct place ?
Thank you .
Re: TransformFeedback problem
Ugh, that's what you get for writing code directly in the browser. :)
Corrected code below:
Afterwards, simply use
TransformFeedbackVaryingsinstead ofGL.TransformFeedbackVaryings.If it still crashes, please post the exception message, this could be useful.
Edit: this code also has an error, see below.
Re: TransformFeedback problem
Thank you .
I added manual TransformFeedback into code .
But program still crashed or threw error that is similar to before .
A name of varying variable mentioned by the error message is strange . (What is "stemBrushesKey" ??)