<div dir="ltr"><div><div><div><div><div><div>I replied myself:<br><br></div>the problem was with this syntax in my fragment shader code:<br><br></div>vec2(-0.75f, -0.5f)<br><br></div>it's legal inside the emulator but *not on real device*.<br>
<br></div>Of course, all it takes to make it work is using float() constructor:<br><br></div>vec2(float(-0.75), float(-0.5))<br><br></div>Hope it could help someone else.<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Apr 10, 2014 at 12:05 PM, Luca Donaggio <span dir="ltr"><<a href="mailto:donaggio@gmail.com" target="_blank">donaggio@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><div>Hi,<br><br></div>Is ShaderEffect QML element supposed to work on device (I'm on 1.0.4.20)?<br><br></div>I'm always getting this error (content of log property):<br><br>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">QOpenGLShader::compile(Fragment): failed</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">*** Problematic Fragment shader source code ***</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">[W] QOpenGLShaderPrivate::compile:326 - #ifndef GL_FRAGMENT_PRECISION_HIGH</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">#define highp mediump</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">#endif</span></p>
<p style="margin:0px;text-indent:0px;font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)"><br></p><p style="margin:0px;text-indent:0px;font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">[... my shader code ...]</p>
<p style="margin:0px;text-indent:0px;font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)"><br></p><p style="margin:0px;text-indent:0px;font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">
</p><p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">***</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">QQuickCustomMaterialShader: Shader compilation failed:</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">[W] QQuickCustomMaterialShader::compile:285 - "failed" </span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">*** Fragment shader ***</span></p>
<p style="margin:0px;text-indent:0px"><span style="font-family:'Monospace';font-size:9pt;color:rgb(60,60,60)">failed</span></p>
<p style="margin:0px;text-indent:0px;font-family:'Monospace';font-size:9pt;font-weight:600;color:rgb(20,20,190)"><br></p><br clear="all"></div>It works just fine on emulator though.<br><br></div><div>Are there some (known) differencies from the GLSL code "understood" by the emulator and a real device?<br>
<br></div><div>Thanks,<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div><div><div><div><div><br>-- <br>Luca Donaggio
</div></div></div></div></div></font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>Luca Donaggio
</div>