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 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 61

Thread: NVIDIA releases OpenGL 4.2 drivers

  1. #11
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    934

    Re: NVIDIA releases OpenGL 4.2 drivers

    Quote Originally Posted by KRONOS
    You're right, the spec requires it. The driver never complained before...
    It was a known an famous NVIDIA drivers bug. It's good to see it fixed despite that VAOs are nothing else than annoying most of the time.

    A workaround and quick fix for you application is to create and bind a VAO at the beginning, (right after the context creation) you can then forget about it.

    No the ultimate fixed but it get you application running again with no other change.

  2. #12
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    934

    Re: NVIDIA releases OpenGL 4.2 drivers

    A little bit of fun, the following image show Fermi rasterizer pattern using the atomic counter:

  3. #13
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    293

    Re: NVIDIA releases OpenGL 4.2 drivers

    I have the following problem with immutable textures: I create a mipmapped 2d texture using glTexStorage2D, requesting the full amount of mip map levels. After this is upload the data of the single mip maps using glTexSubImage. The problem is the resulting texture objects does not have any mip maps. When i exchange the glTexStorage call by calls to glTexImag2D for all mip map levels the texture is correctly initialized with all mip maps filled.

    NOT working:
    Code :
    glTexStorage2D(object_target(),
                   init_mip_levels,
                   util::gl_internal_format(in_desc._format),
                   in_desc._size.x, in_desc._size.y);
    // no error reported
    for (unsigned i = 0; i < init_mip_levels; ++i) {
        math::vec2ui lev_size      = util::mip_level_dimensions(in_desc._size, i);
        const void*  init_lev_data = in_initial_mip_level_data[i];
        glTexSubImage2D(object_target(),
                        i,
                        0, 0,
                        lev_size.x, lev_size.y,
                        gl_base_format,
                        gl_base_type,
                        init_lev_data);
    }
    // still no errors reported

    working:
    Code :
    for (unsigned i = 0; i < init_mip_levels; ++i) {
        math::vec2ui lev_size      = util::mip_level_dimensions(in_desc._size, i);
        glTexImage2D(object_target(),
                     i,
                     util::gl_internal_format(in_desc._format),
                     lev_size.x, lev_size.y,
                     0,
                     gl_base_format,
                     gl_base_type,
                     0);
    }
     
    // no error reported
    for (unsigned i = 0; i < init_mip_levels; ++i) {
        math::vec2ui lev_size      = util::mip_level_dimensions(in_desc._size, i);
        const void*  init_lev_data = in_initial_mip_level_data[i];
        glTexSubImage2D(object_target(),
                        i,
                        0, 0,
                        lev_size.x, lev_size.y,
                        gl_base_format,
                        gl_base_type,
                        init_lev_data);
    }
    // still no errors reported

  4. #14
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Czech Republic
    Posts
    317

    Re: NVIDIA releases OpenGL 4.2 drivers

    I have the following problem with immutable ...
    Well, it works in my code. I've implemented it today.

    The only road block was the incompatible internal format. It requires sized format. Such as GL_RGBA8 instead of GL_RGBA. The documentation states that correctly. (My fault).

    I am going to test the performance changes ....

  5. #15
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    293

    Re: NVIDIA releases OpenGL 4.2 drivers

    Could you check that you really see trilinear or anisotropic filtering on your tests? I always see the base level as if I had only a single level texture in every test I did using sampler objects and plain texture parameters.

  6. #16
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    934

    Re: NVIDIA releases OpenGL 4.2 drivers

    Works well for me like what follows but I haven't use the sampler object with it yet:

    Code :
    	gli::texture2D Image = gli::load(TEXTURE_DIFFUSE);
     
    	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
     
    	glGenTextures(1, &amp;TextureName);
    	glActiveTexture(GL_TEXTURE0);
    	glBindTexture(GL_TEXTURE_2D, TextureName);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1000);
    	glTexStorage2D(GL_TEXTURE_2D, GLint(Image.levels()), GL_RGBA8, GLsizei(Image[0].dimensions().x), GLsizei(Image[0].dimensions().y));
     
    	for(std::size_t Level = 0; Level < Image.levels(); ++Level)
    	{
    		glTexSubImage2D(
    			GL_TEXTURE_2D, 
    			GLint(Level), 
    			0, 0, 
    			GLsizei(Image[Level].dimensions().x), 
    			GLsizei(Image[Level].dimensions().y), 
    			GL_BGRA, GL_UNSIGNED_BYTE, 
    			Image[Level].data());
    	}
     
    	glPixelStorei(GL_UNPACK_ALIGNMENT, 4);

  7. #17
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Germany
    Posts
    293

    Re: NVIDIA releases OpenGL 4.2 drivers

    Ok i triple checked using sampler objects and no sampler objects with essentially the code by Groovounet. I still do not get trilinear filtering (checked with colored mip levels), i can clearly see massive texture aliasing and only see the date from level 0. When switching to the glTexImage loop of my original post everything works as expected.

    I am on Windows 7 x64 using the 280.28 driver. The context is a 4.2 core profile context (also checked with compatibility).

  8. #18
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948

    Re: NVIDIA releases OpenGL 4.2 drivers

    It requires sized format.
    It does? Oh thank God. It's about time they shoved those unsized formats out the door.

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

    Re: NVIDIA releases OpenGL 4.2 drivers

    Ok, Groovounet my friend , you have the exact same problem... you did not test what i was describing:

    1. your dds image did not contain mipmaps!
    2. you didn't even try to enable trilinear filtering!

    you can find attached a modified sample and sample image which clearly shows the problem i described.

    the fun part is this:
    Code :
    #if 1
        glTexStorage2D(GL_TEXTURE_2D, GLint(Image.levels()), GL_RGBA8, GLsizei(Image[0].dimensions().x), GLsizei(Image[0].dimensions().y));
    #else
        for(std::size_t Level = 0; Level < Image.levels(); ++Level)
        {
            glTexImage2D(
                GL_TEXTURE_2D, 
                GLint(Level), 
                GL_RGBA8, 
                GLsizei(Image[Level].dimensions().x), 
                GLsizei(Image[Level].dimensions().y),
                0, 
                GL_BGRA, GL_UNSIGNED_BYTE, 
                0);
        }
    #endif

  10. #20
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    934

    Re: NVIDIA releases OpenGL 4.2 drivers

    LOL, i made a couple of tests and I was about to write that I had the same problem but you beat me that it!

Posting Permissions

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