Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Basic compute shader example using QShaderProgram
Forum Updated to NodeBB v4.3 + New Features

Basic compute shader example using QShaderProgram

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt3dshader
3 Posts 2 Posters 1.3k Views 1 Watching
  • 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.
  • C Offline
    C Offline
    canol
    wrote on last edited by
    #1

    Hello, I have a big array of int32 numbers (100,000,000 elements). I would like to basically do some numeric calculations on this array using computer shaders so that the calculations are very fast. I see that Qt has QShaderProgram which seems to support compute shaders. But I cannot find a basic example on how to use it.

    Would it be possible for somebody to give me an example of how to create a simple compute shader program using QShaderProgram? For example, a program that would calculate the square of the input array elements?

    Or maybe I am looking at the wrong API and there is another way to take advantage of GPU using Qt?

    PS: I would like to use Qt (instead of, say, CUDA) because my program is already using Qt for GUI, so I would prefer to not add another dependency if possible.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I haven't tested it but there's this GitHub project that might be of interest.

      Hope it helps.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      C 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        I haven't tested it but there's this GitHub project that might be of interest.

        Hope it helps.

        C Offline
        C Offline
        canol
        wrote on last edited by
        #3

        @SGaist Thank you, I will check it out.

        1 Reply Last reply
        0

        • Login

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