xuxiandi / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

detachShader unlinks the program #221

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a program with shaders attached and link it
2. Detach one of the shaders
3. Try to use the program

What is the expected output? What do you see instead?

The program should work. Instead the program is unlinked and doesn't work.

GLES 2.0 spec 
http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.24.pdf
page 30 says that:

While a valid program object is in use, applications are free to modify attached
shader objects, compile attached shader objects, attach additional shader 
objects,
and detach shader objects. These operations do not affect the link status or 
executable code of the program object.

The unlink call is in the detachShader method:
http://www.google.com/codesearch#yFOqulIej54/trunk/src/libGLESv2/Program.cpp&q=d
etachShader%20package:http://angleproject%5C.googlecode%5C.com&l=123

Original issue reported on code.google.com by ilm...@google.com on 3 Oct 2011 at 10:12

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. The spec is a bit unclear on what happens with 
program objects which are not in use, but clearly we should not always be 
calling unlink() in detachShader().

Original comment by nicolas....@gmail.com on 3 Oct 2011 at 12:29

GoogleCodeExporter commented 9 years ago
Attached test case.

Correct behavior should be two solid triangles on the screen. If only one 
triangles appears or two triangles appear but are flashing, something is wrong.

Original comment by ilm...@google.com on 3 Oct 2011 at 6:47

Attachments:

GoogleCodeExporter commented 9 years ago
Simply removing the unlink() call seems to fix the issue and I found no 
regressions so far. We'll do some further reviewing and testing and get this 
resolved soon. Thanks for the test case.

Original comment by nicolas....@gmail.com on 3 Oct 2011 at 7:35

GoogleCodeExporter commented 9 years ago
Fixed in r781.

Original comment by nicolas....@gmail.com on 4 Oct 2011 at 6:59