Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. ShaderEffect does not work on raspberry yocto

ShaderEffect does not work on raspberry yocto

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 331 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MesrineM Offline
    MesrineM Offline
    Mesrine
    wrote on last edited by Mesrine
    #1

    Hello everyone,
    I have been playing with shaders and Qt. I have created this repo
    https://github.com/EddyTheCo/OMClient

    That uses shaders. The shaders are shown correctly on WASM and Linux desktops. But in a yocto image with meta-qt6 in a raspberry-pi 3b it gives the runtime error:

    Failed to register allocate:
    BLOCK 0:
    ...
    A lot of stuff
    ...
    2       E2273, E2278 v8adds tlb_c, t2273,t2278
    

    And nothing is shown. This messages comes from mesa-vc4.
    I have some shaders that work ok on the Raspberry, but this one gives this runtime error.
    The shader code works if I change the code showing the drawing but if add more code it does not.

    Like this works:

    void main( void)
    {
        vec2 uv=vec2(qt_TexCoord0.x*2.0-1.0,1.0-qt_TexCoord0.y*2.0);
        uv.x *= pixelStep.y/pixelStep.x;
    
        vec3 fcolor=vec3(0.0);
    
        fcolor= codeZeroAm(uv) /*+
                codeZeroPm(uv) +
                codeOneAm(uv)  +
                codeOnePm(uv)  +
                codeTwoAm(uv)  +
                codeTwoPm(uv)  +
                codeThree(uv)*/;
    
    
        vec4 bcolor=texture(src, uv).rgba;
        vec4 color=mix(bcolor, vec4(fcolor,1.0), step(0.0000001,length(fcolor)));
    
        fragColor = vec4(fcolor,1.0);
    
    }
    

    but like this

    void main( void)
    {
        vec2 uv=vec2(qt_TexCoord0.x*2.0-1.0,1.0-qt_TexCoord0.y*2.0);
        uv.x *= pixelStep.y/pixelStep.x;
    
        vec3 fcolor=vec3(0.0);
    
        fcolor= codeZeroAm(uv) +
                codeZeroPm(uv) /*+
                codeOneAm(uv)  +
                codeOnePm(uv)  +
                codeTwoAm(uv)  +
                codeTwoPm(uv)  +
                codeThree(uv)*/;
    
    
        vec4 bcolor=texture(src, uv).rgba;
        vec4 color=mix(bcolor, vec4(fcolor,1.0), step(0.0000001,length(fcolor)));
    
        fragColor = vec4(fcolor,1.0);
    
    }
    

    gives the runtime error.

    Any help will be much appreciated.

    MesrineM 1 Reply Last reply
    0
    • MesrineM Mesrine

      Hello everyone,
      I have been playing with shaders and Qt. I have created this repo
      https://github.com/EddyTheCo/OMClient

      That uses shaders. The shaders are shown correctly on WASM and Linux desktops. But in a yocto image with meta-qt6 in a raspberry-pi 3b it gives the runtime error:

      Failed to register allocate:
      BLOCK 0:
      ...
      A lot of stuff
      ...
      2       E2273, E2278 v8adds tlb_c, t2273,t2278
      

      And nothing is shown. This messages comes from mesa-vc4.
      I have some shaders that work ok on the Raspberry, but this one gives this runtime error.
      The shader code works if I change the code showing the drawing but if add more code it does not.

      Like this works:

      void main( void)
      {
          vec2 uv=vec2(qt_TexCoord0.x*2.0-1.0,1.0-qt_TexCoord0.y*2.0);
          uv.x *= pixelStep.y/pixelStep.x;
      
          vec3 fcolor=vec3(0.0);
      
          fcolor= codeZeroAm(uv) /*+
                  codeZeroPm(uv) +
                  codeOneAm(uv)  +
                  codeOnePm(uv)  +
                  codeTwoAm(uv)  +
                  codeTwoPm(uv)  +
                  codeThree(uv)*/;
      
      
          vec4 bcolor=texture(src, uv).rgba;
          vec4 color=mix(bcolor, vec4(fcolor,1.0), step(0.0000001,length(fcolor)));
      
          fragColor = vec4(fcolor,1.0);
      
      }
      

      but like this

      void main( void)
      {
          vec2 uv=vec2(qt_TexCoord0.x*2.0-1.0,1.0-qt_TexCoord0.y*2.0);
          uv.x *= pixelStep.y/pixelStep.x;
      
          vec3 fcolor=vec3(0.0);
      
          fcolor= codeZeroAm(uv) +
                  codeZeroPm(uv) /*+
                  codeOneAm(uv)  +
                  codeOnePm(uv)  +
                  codeTwoAm(uv)  +
                  codeTwoPm(uv)  +
                  codeThree(uv)*/;
      
      
          vec4 bcolor=texture(src, uv).rgba;
          vec4 color=mix(bcolor, vec4(fcolor,1.0), step(0.0000001,length(fcolor)));
      
          fragColor = vec4(fcolor,1.0);
      
      }
      

      gives the runtime error.

      Any help will be much appreciated.

      MesrineM Offline
      MesrineM Offline
      Mesrine
      wrote on last edited by
      #2

      @Mesrine

      I have optimized my shaders and now they work on the raspberry pi. There seems to be a problem with the number of registers the raspberry pi has with respect to other devices.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved