Reading and writing to the same texture at the same time is undefined 
behaviour in OpenGLES2 (but often works by accident), and was made illegal 
in WebGL, because WebGL tries to eliminate all undefined behaviour, see 
here for details:

https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.26

One reason could be that you are trying toread from the depth buffer in a 
fragment shader which was written in a previous pass, but the same depth 
buffer is still bound because depth tests must happen. Only way out in this 
situation is to copy the depth information into a separate texture, I guess.

Or it is an oversight and you are accidently rendering to a framebuffer 
which has a color attachment texture which is also bound to a texture unit. 
For this case, I clear all texture bindings when binding a new framebuffer 
to make sure that a texture used to render to isn't still bound to a 
texture bind slot.

Cheers,
-Floh.

Am Donnerstag, 6. April 2017 13:00:07 UTC+2 schrieb Alon Faraj:
>
> I have c++ app that works in windows, Im using emscripten to render 
> Webgl2  in  chrome but I get an error -
>
> [.Offscreen-For-WebGL-0000000007A2F810]GL ERROR :GL_INVALID_OPERATION : 
> glDrawElements: Source and destination textures of the draw are the same.
>
> after that, the canvas is freezing.
>
> everything works as expected in windows - how can I debug this? why its 
> happen?
>
>  PS - for unknown reasons I cant run the app in forefox to check if the 
> problem is only in chrome or cross browsers.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to