Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: OpenGL + parallelism shader

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    6

    OpenGL + parallelism shader

    Hello,
    today everywhere you can read about new mobile GPUs like Tegra and the number of vertex and fragment shaders.

    For example Tegra can only use OpenGL and no CUDA and no OpenCL. I ask me how to use more than one vertex
    and fragment shader? In Opengl the programmer only has to write code for the vertex and fragment shader but
    he has not to choose options for more shaders.On the other hand CUDA is made for parallism programming
    and it is easy to use.


    But my main problem is which part in modern OpenGL Systems is proper for parallelism execution on the shaders?

  2. #2
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,171

    Re: OpenGL + parallelism shader

    You have posted this question in the drivers section.
    Please don't cross-post! Have you read the posting guidelines?

  3. #3
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    303

    Re: OpenGL + parallelism shader

    What do you mean by more shaders? The other kinds of shaders like geometry and tessellation? Those aren't available on OpenGL ES. As for GPGPU on mobile devices, you can use the 'old' way and use the fragment shader for this. Some mobile GPUs would be capable of OpenCL (embedded) (ImgTec SGX) but there are no drivers available right now.

    You write your vertex and fragment shaders with one vertex/fragment in mind and the driver will run those on as many cores as it has availabe without you needing to know how much is done in parallel and how much sequentially.

    And yes, please no cross posts.

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    6

    Re: OpenGL + parallelism shader

    Hallo,
    thank you for the answer and sorry for cross-post. I’ll never do that again.

    To my question: I read that Tegra 2 has 4 Pixelshader and 4 Vertexshader and i try to understand how to use more than one pixelshader and vertexshader. Because if I program OpenGL Code i only can programm one vertex shader and one pixelshader. But how can i use the 4 Pixelshader? Or does the compiler solves this problem depending on the used hardware?
    Thank you for your answers...
    Ari

  5. #5
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: OpenGL + parallelism shader

    These hardware specs are features used being the scenes to compute faster, you have nothing to do to take advantage of it.

    You realise that a single vertex shader is often applied to a large number of vertices at the same time right ? Same for fragment shader.

  6. #6
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    954

    Re: OpenGL + parallelism shader

    Ari, you have to understand what shader means.

    Shader is a program that executes on a shader processing unit. When you say the GPU has 4 shaders, you actually mean 4 processing units (PU). On each PU you can execute arbitrary number of shaders, the same way you can execute numerous procedures on the CPU, but one at the time.

    A shader executes upon all "elements" (vertices, patch control points, drawing primitives, fragments) being drawn by a current draw command. A driver and accompanying (controlling) code allocates as much as possible PUs in order to process all "elements" as fast as possible (and in parallel). In graphics API you cannot control the parallelism of the execution.

    So, write your fragment shader (since transform feedback is not available on OpenGL ES afaik) and catch results in a texture or a frame-buffer without worrying about the parallelism. The drivers will give their best.

  7. #7
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    6

    Re: OpenGL + parallelism shader

    Thank you for the explanatory notes.
    I think I misunderstood shaders and the German literature helped me to misunderstand :-)

    Is there a way to influence the PUs as for me without graphics API?

  8. #8
    Junior Member Regular Contributor Kopelrativ's Avatar
    Join Date
    Apr 2011
    Posts
    212

    Re: OpenGL + parallelism shader

    I think you need to explain what it is you really want to do.

  9. #9
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: OpenGL + parallelism shader

    Quote Originally Posted by ari.kaspari
    But my main problem is which part in modern OpenGL Systems is proper for parallelism execution on the shaders?
    Isn't the Tegra for mobile systems?
    http://www.nvidia.com/object/tegra.html

    and mobile systems do not come with OpenGL.
    They have OpenGL ES 1.0 or 1.1 or 2.0.

    This is the Tegra 3 technical page
    http://www.nvidia.com/object/tegra-3-processor.html

    and they say that it supports OpenGL ES 2.0.
    In that case, you are probably better off asking questions in the forums at www.khronos.org (since your q is about GL ES).
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  10. #10
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    6

    Re: OpenGL + parallelism shader

    Yes, the Tegra is a mobile system and yes I know i have to use OpeglES but in this forum is more traffic than in other OpenglES ones. Because of this I asked here with succeed to expand my basic knowledge. Thank you very much.

    @ Kopelrativ: I would like to use a modern GPU to calculate Mathmatrices. In this way i would use as much as possible parallelism.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •