Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After hours of further research I've found out that this problem is specific to Adreno 200 GPU that is utilized in my Samsung Galaxy Ace (GT-S5830). It seems like Adreno 200 driver assigns the texture to the sampler in the first call to a drawing function and after that it ignores any changes to the sampler value (<code>glUniform1i(samplerLocation, textureImageUnit)</code>) until one of the two occurs:</p> <ul> <li><code>glUseProgram</code> is called with a different shader program,</li> <li>a different texture is bound to any texture image unit used by the shader program.</li> </ul> <p>There's a <a href="https://developer.qualcomm.com/forum/qdevnet-forums/mobile-gaming-graphics-optimization-adreno/8896" rel="nofollow">thread</a> in the forums of the manufacturer of Adreno 200 GPU describing the very same problem.</p> <p>So if you call drawing functions several times with the same shader program and with different textures bound before, there are two workarounds to the described problem:</p> <ol> <li><p>Call <code>glUseProgram(0); glUseProgram(yourDrawingProgram);</code> before every drawing function.</p></li> <li><p>Before every drawing call, bind different texture to at least one texture image unit used by your shader program. This solution can be difficult to maintain, because if you bind the same texture that is already bound to the texture image unit, the problem will remain. So in this case the easiest solution is to simply not change sampler values and bind textures of all texture image units used by the shader program before every drawing call.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload