Search Unity

Using a shader as a data object causes hangs on old devices when modifying while rendering

Discussion in 'Shaders' started by greyhoundgames, Jan 27, 2019.

  1. greyhoundgames

    greyhoundgames

    Joined:
    Jan 24, 2014
    Posts:
    32
    In my scenario I have a shader who has a texture used to convey data. It works fine on editor and most devices, but on a test Samsung S5, I get an open gl exception:

    [EGL] Unable to acquire context: EGL_BAD_ACCESS: EGL cannot access a requested resource (for example a context is bound in another thread).

    I noticed that if I don't touch the texture which is being modified in unity(via set pixels every frame) the problem does not happen. Anyone know how to avoid this issue? I do not have graphics jobs on which is it the main hit i get for this kind of error on google.

    I have since tried double buffering in effect to try to not modify the texture that the shader is going to use that frame but that doesn't seem to fix this issue

    [Update] I removed the writing to texture portion and it still gets this error. It seems to be some specific issue of the Samsung S5...
     
    Last edited: Jan 27, 2019