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 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 61

Thread: NVIDIA releases OpenGL 4.2 drivers

  1. #31
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Czech Republic
    Posts
    317

    Re: NVIDIA releases OpenGL 4.2 drivers

    Thanks Piers. Driver 280.36 is improvement.
    But there is still some weird performance issue. When I use the glTexStorage2D with no mipmaps then I get decent performance improvement over R275. Mostly because the first glTexSubImage after creating the texture does not suffer any slowdown (more here: http://www.opengl.org/discussion_boa...;Number=301023).

    But when I enable the mipmaps then creating textures with glTexStorage2D is about 10 times slower then calling glTexImage2D(..., NULL) for each level. The slowdown in previous drivers was caused by glGenerateMipmap. In this drivers any simple call to OGL stalls a bit. (5-7ms)

  2. #32
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: NVIDIA releases OpenGL 4.2 drivers

    What do you mean by "enable the mipmaps"? The way glTexStorage2D should be used is that it is pretty much the first thing you call on a texture object.

  3. #33
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Czech Republic
    Posts
    317

    Re: NVIDIA releases OpenGL 4.2 drivers

    Quote Originally Posted by Alfonse Reinheart
    What do you mean by "enable the mipmaps"? The way glTexStorage2D should be used is that it is pretty much the first thing you call on a texture object.
    I "enabled" it my app. In the end it means I requested to allocate certain number of mipmap levels in OGL and later using mipmap texture sampling. So nothing special actually.

  4. #34
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    293

    Re: NVIDIA releases OpenGL 4.2 drivers

    I still have issues with the binding layout specifier. For example a simple shader:

    Code :
    #version 420 core
     
    in per_vertex {
        vec3 tex_coord;
    } v_in;
     
    // attribute layout definitions ///////////////////////////////////////////////////////////////////
    layout(location = 0, index = 0) out vec4 out_color;
     
    layout(binding = 0) uniform sampler2D tex_image;
    layout(binding = 1) uniform sampler3D tex_volume;
     
    main()
    {
        //vec4 c = texture(tex_image, v_in.tex_coord.xy);
        vec4 c = texture(tex_volume, v_in.tex_coord);
     
        out_color = c;
    }

    On the client side i just bind the textures with according sampler objects to the unit 0 and 1 without setting the according uniform values to 0 an 1. When using the 2D sampler in the shader i get the results, but when using the 3D texture and thus eliminating the 2D sampler in the link process i get no results.

  5. #35
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: NVIDIA releases OpenGL 4.2 drivers

    BTW, you should know that if a fragment shader has only one user-defined output variable, it will automatically be bound to location=0, index=0. So there's no need to explicitly state it.

  6. #36
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    293

    Re: NVIDIA releases OpenGL 4.2 drivers

    I know that, but i like it explicit.

  7. #37
    Intern Contributor
    Join Date
    Mar 2010
    Posts
    58

    Re: NVIDIA releases OpenGL 4.2 drivers

    @mfort
    > But when I enable the mipmaps then creating textures with glTexStorage2D is about 10 times slower then calling glTexImage2D(..., NULL) for each level.

    With the latest 280.36 driver the glTexStorage2D will allocate the hardware surfaces upfront instead of deferring it to the glTexSubImage2D calls. The older style glTexImage2D(,,NULL) calls won't create the hardware surface.

    Overall, calling glTexStorage2D and then glTexSubImage2D for each level should be about the same performance as glTexImage2D(,,NULL) then glTexSubImage2D for each level. And they should both be faster than using glGenerateMipmaps or glTexParameter(GL_GENERATE_MIPMAP, TRUE). The advantage of glTexStorage2D is that the surface allocation happens immediatly and the texture is immutable (except for image data).

    If this is not the performance what you're seeing in your app, could you paste some code/pseudo-code to explain where performance is falling short. Thanks.

  8. #38
    Intern Contributor
    Join Date
    Mar 2010
    Posts
    58

    Re: NVIDIA releases OpenGL 4.2 drivers

    @Chris Lux
    I'll investigate this bug and respond soon.

  9. #39
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    293

    Re: NVIDIA releases OpenGL 4.2 drivers

    Quote Originally Posted by Piers Daniell
    @Chris Lux
    I'll investigate this bug and respond soon.
    Thanks for your efforts, fortunately it was a problem on my end. Everything now seems to work as expected...

    -chris

  10. #40
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    293

    Re: NVIDIA releases OpenGL 4.2 drivers

    Quote Originally Posted by Piers Daniell
    With the latest 280.36 driver the glTexStorage2D will allocate the hardware surfaces upfront instead of deferring it to the glTexSubImage2D calls. The older style glTexImage2D(,,NULL) calls won't create the hardware surface.
    I am also seeing some strange performance hits when using TexStorage. In the following log example i am generating two volume textures and one 1D texture:
    - using TexStorage3D to allocate the texture image including mipmaps
    - then i upload the first level using TexSubImage3D
    - after that i use GenerateMipmap to generate the missing mipmaps

    As you can see the first volume is completed very fast. Then the second takes a huge amount of time for TexStorage3D. What is _most_ interesting is that TexStorage+TexSubImage on the 1D texture after the two volume textures takes also extremely long...

    This was tested on Windows 7 x64, GeForce GTX 480 1.5GiB, 280.36. The times were taken using QueryPerformanceCounter.

    Code :
    volume_data::volume_data(): loading raw volume...
    >     allocating texture storage (dimensions: (501  401  576), format: R_8, mip-level: 10, size : 110.358MiB)...
    >     allocating texture storage done. (elapsed time: 0.000s)
    >     uploading source mip-level 0...
    >     uploading source mip-level 0 done. (elapsed time: 0.059s)
    >     generating mip-levels 1 - 10 ...
    >     generating mip-levels 1 - 10 done. (elapsed time: 0.000s)
    volume_data::volume_data(): loading raw volume done.
     
    volume_data::volume_data(): generating pre-multiplied volume...
    >     generating color and alpha lookup tables...
    >     generating color and alpha lookup tables done. (elapsed time: 0.000s)
    >     starting pre-multiplication...
    >     pre-multiplication done. (elapsed time: 0.430s)
    >     allocating texture storage (dimensions: (501  401  576), format: RGBA_8, mip-level: 10, size : 441.433MiB)...
    >     allocating texture storage done. (elapsed time: 7.278s)
    >     uploading source mip-level 0 ...
    >     uploading source mip-level 0 done. (elapsed time: 3.884s)
    >     generating mip-levels 1 - 10 ...
    >     generating mip-levels 1 - 10 done. (elapsed time: 0.002s)
    volume_data::volume_data(): generating pre-multiplied volume done.
     
    volume_data::volume_data(): generating color map...
    >     generating color map texture data...
    >     generating color map texture data done. (elapsed time: 0.001s)
    >     allocating texture storage and uploading texture data (dimensions: 256, format: RGBA_8, mip-level: 1, size : 1.000KiB)...
    >     allocating texture storage and uploading texture data done. (elapsed time: 10.247s)

Posting Permissions

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