gxquickly / angleproject

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

When CompilerD3D and CompilerGL coexist, ShFinalize() can be called when there are still live compilers #1012

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run angle_end2end_tests with 
https://chromium-review.googlesource.com/#/c/260232/35 applied

What is the expected output? What do you see instead?
Expected: Tests run to completion
Actual: Assert related to PoolIndex

The issue happens because when CompilerD3D and CompilerGL coexist, there can be 
a sequence of events
like this:

* CompilerGL::getCompilerHandle()
* CompilerD3D::getCompilerHandle()
* CompilerD3D::release()

In this case, CompilerD3D::release will incorrectly call ShFinalize() even 
though CompilerGL still holds compiler handles.

Original issue reported on code.google.com by oetu...@nvidia.com on 26 May 2015 at 1:32

GoogleCodeExporter commented 9 years ago
Good digging. Sounds like we might need a shader translator cache, like in 
Chromium (shader_translator_cache.h/cc)

Original comment by jmad...@chromium.org on 26 May 2015 at 2:05

GoogleCodeExporter commented 9 years ago
The assert stopped reproducing in end2end_tests after I fixed the 
BuiltInFunctionEmulator memory issue, so I suppose it's only an issue there if 
there are other errors. Still, this seems worth fixing in some way. The 
simplest way would be switching to one global compiler handle counter.

Original comment by oetu...@nvidia.com on 26 May 2015 at 2:42