Nux

Merge lp:~vanvugt/nux/fix-1064834 into lp:nux

Proposed by Daniel van Vugt
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 685
Merged at revision: 686
Proposed branch: lp:~vanvugt/nux/fix-1064834
Merge into: lp:nux
Diff against target: 40 lines (+2/-7)
1 file modified
NuxGraphics/IOpenGLSurface.cpp (+2/-7)
To merge this branch: bzr merge lp:~vanvugt/nux/fix-1064834
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
jenkins continuous-integration Pending
Review via email: mp+128863@code.launchpad.net

Commit message

Remove a massive bottleneck, where almost all the CPU time was spent
loading a black image on texture creation. (LP: #1064834)

CPU time spent in glTexImage2D:
  Before: 93.54%
  After: 0.10%

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NuxGraphics/IOpenGLSurface.cpp'
--- NuxGraphics/IOpenGLSurface.cpp 2012-01-17 03:57:31 +0000
+++ NuxGraphics/IOpenGLSurface.cpp 2012-10-10 06:33:21 +0000
@@ -525,8 +525,6 @@
525 nuxAssert( texheight > 0 ); // Should never happen525 nuxAssert( texheight > 0 ); // Should never happen
526 nuxAssert( size > 0 ); // Should never happen526 nuxAssert( size > 0 ); // Should never happen
527527
528 BYTE *DummyBuffer = (BYTE *) calloc(size, sizeof(BYTE));
529
530 CHECKGL(glPixelStorei(GL_UNPACK_ALIGNMENT, MemAlignment));528 CHECKGL(glPixelStorei(GL_UNPACK_ALIGNMENT, MemAlignment));
531529
532#ifndef NUX_OPENGLES_20530#ifndef NUX_OPENGLES_20
@@ -546,7 +544,7 @@
546 texheight,544 texheight,
547 0, // border545 0, // border
548 size, // image Size546 size, // image Size
549 DummyBuffer // data547 NULL // data
550 );548 );
551 CHECKGL_MSG(glCompressedTexImage2DARB);549 CHECKGL_MSG(glCompressedTexImage2DARB);
552 }550 }
@@ -580,7 +578,7 @@
580 0, // border578 0, // border
581 GPixelFormats[_BaseTexture->_PixelFormat].Format,579 GPixelFormats[_BaseTexture->_PixelFormat].Format,
582 GPixelFormats[_BaseTexture->_PixelFormat].type,580 GPixelFormats[_BaseTexture->_PixelFormat].type,
583 DummyBuffer);581 NULL);
584 CHECKGL_MSG(glTexImage2D);582 CHECKGL_MSG(glTexImage2D);
585#ifndef NUX_OPENGLES_20583#ifndef NUX_OPENGLES_20
586 }584 }
@@ -602,9 +600,6 @@
602 }600 }
603#endif601#endif
604602
605 free(DummyBuffer);
606
607
608 // { //[DEBUGGING - Red Texture]603 // { //[DEBUGGING - Red Texture]
609 // // This is going to put some red in the texture.604 // // This is going to put some red in the texture.
610 // // The texture is not compressed.605 // // The texture is not compressed.

Subscribers

People subscribed via source and target branches