Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6137389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:43:14+00:00 2026-05-23T17:43:14+00:00

Basically, I’m doing some sort of image processing using a screen-sized rectangle made of

  • 0

Basically, I’m doing some sort of image processing using a screen-sized rectangle made of two triangles and a fragment shader, which is doing the whole processing stuff. The actual effect is something like an animation as it depends on a uniform variable, called current_frame.

I’m very much interested in measuring the performance in terms of “MPix/s”. What I do is something like that:

/* Setup all necessary stuff, including:                 */
/* - getting the location of the `current_frame` uniform */
/* - creating an FBO, adding a color attachment          */
/*   and setting it as the current one                   */

double current_frame = 0;
double step = 1.0f / NUMBER_OF_ITERATIONS;

tic(); /* Start counting the time */

for (i = 0; i < NUMBER_OF_ITERATIONS; i++)
{
    glUniform1f(current_frame_handle, current_frame);
    current_frame += step;
    glDrawArrays(GL_TRIANGLES, 0, NUMBER_OF_INDICES);
    glFinish();
}

double elapsed_time = tac(); /* Get elapsed time in seconds */

/* Calculate achieved pixels per second */
double pps = (OUT_WIDTH * OUT_HEIGHT * NUMBER_OF_ITERATIONS) / elapsed_time;

/* Sanity check by using reading the output into a buffer */
/* using glReadPixels and saving this buffer into a file  */

As far as theory goes, is there anything wrong with my concept?

Also, I’ve got the impression that glFinish() on mobile hardware doesn’t necessarily wait for previous render calls and may do some optimizations.

Of course, I can always force it by doing glReadPixels() after each draw, but that would be quite slow so that this wouldn’t really help.

Could you advise me as to whether my testing scenario is sensible and whether there is something more that can be done.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:43:14+00:00Added an answer on May 23, 2026 at 5:43 pm

    Concerning speed, using glDrawArrays() still duplicates the shared vertices.

    glDrawElements() is the solution to reduce the number of vertices in
    the array, so it allows transferring less data to OpenGL.

    http://www.songho.ca/opengl/gl_vertexarray.html

    Just throwing that in there to help speed up your results. As far as your timing concept, it looks fine to me. Are you getting results similar to what you had hoped?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I'm using python to print out some information in the terminal and some
Basically I have some sort of third party software running on Windows 7 which
Basically I have some code to check a specific directory to see if an
Basically I want to know how to set center alignment for a cell using
Basically I have two models: User and Godfather. The godfather table has three columns:
Basically I have this server app I built in vc#, and for some reason
Basically what I want to do it this: a pdb file contains a location
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I'm going to go a bit broad here and ask a few questions
Basically, I would like a brief explanation of how I can access a SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.