[vlc-devel] [PATCH v2 06/11] qml: specify the precision in FrostedGlassEffect shader

Pierre Lamot pierre at videolabs.io
Wed Sep 16 09:57:11 CEST 2020


On 2020-09-16 09:43, Romain Vimont wrote:
> On Wed, Sep 16, 2020 at 09:24:54AM +0200, Pierre Lamot wrote:
>>   ANGLE expect the precision of all variable to be defined
>> ---
>>  modules/gui/qt/widgets/qml/FrostedGlassEffect.qml | 12 ++++++------
>>  1 file changed, 6 insertions(+), 6 deletions(-)
>> 
>> diff --git a/modules/gui/qt/widgets/qml/FrostedGlassEffect.qml 
>> b/modules/gui/qt/widgets/qml/FrostedGlassEffect.qml
>> index d390825679..8d90803150 100644
>> --- a/modules/gui/qt/widgets/qml/FrostedGlassEffect.qml
>> +++ b/modules/gui/qt/widgets/qml/FrostedGlassEffect.qml
>> @@ -84,22 +84,22 @@ Rectangle {
>>                      uniform lowp float tintStrength;
>> 
>> 
>> -                    float rand(vec2 co){
>> +                    mediump float rand(highp vec2 co){
> 
> Maybe "precision mediump float;" at the beginning of the shader could
> avoid repeating this modifier everywhere? (unless it is not supported 
> by
> ANGLE)

I'll check that, thanks.

>>                          return fract(sin(dot(co.xy 
>> ,vec2(12.9898,78.233))) * 43758.5453);
>>                      }
>> 
>> 
>> -                    vec4 exclude(vec4 src, vec4 dst)
>> +                    mediump vec4 exclude(mediump vec4 src, mediump 
>> vec4 dst)
>>                      {
>>                          return src + dst - 2.0 * src * dst;
>>                      }
>> 
>>                      void main() {
>> -                       float r = rand(qt_TexCoord0) - 0.5;
>> -                       vec4 noise = vec4(r,r,r,1.0) * noiseStrength;
>> -                       vec4 blured  = texture2D(source, 
>> qt_TexCoord0);
>> +                       mediump float r = rand(qt_TexCoord0) - 0.5;
>> +                       mediump vec4 noise = vec4(r,r,r,1.0) * 
>> noiseStrength;
>> +                       mediump vec4 blured  = texture2D(source, 
>> qt_TexCoord0);
>> 
>> -                       vec4 exclColor = vec4(exclusionStrength, 
>> exclusionStrength, exclusionStrength, 0.0);
>> +                       mediump vec4 exclColor = 
>> vec4(exclusionStrength, exclusionStrength, exclusionStrength, 0.0);
>> 
>>                         blured = exclude(blured, exclColor);
>> 
>> --
>> 2.25.1
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list