[psychonauts] Expected performance on Intel Sandybridge?

jvoss at altsci.com jvoss at altsci.com
Fri Jun 22 03:36:03 EDT 2012


Hello,

I had this problem on IvyBridge and debugged it. I am going to submit a bug report/patch to Mesa but perhaps it will be useful for the developer of Psychonauts.

Note that this patch may have unintended consequences because it hasn't been properly tested but it does fix the low FPS bug.

diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 1381110..f14ef40 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -81,7 +81,10 @@ fast_read_depth_pixels( struct gl_context *ctx,
 
    for (j = 0; j < height; j++) {
       if (type == GL_UNSIGNED_INT) {
-        _mesa_unpack_uint_z_row(rb->Format, width, map, (GLuint *)dst);
+        // Javantea: Alas this is too slow, I comment it out until I understand better.
+        // FIXME: Javantea is doing something very silly here. Undo with prejudice.
+        // It doesn't seem to hurt anything in Psychonauts and fixes the performance 60%
+        //_mesa_unpack_uint_z_row(rb->Format, width, map, (GLuint *)dst);
       } else {
         ASSERT(type == GL_UNSIGNED_SHORT && rb->Format == MESA_FORMAT_Z16);
         memcpy(dst, map, width * 2);
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 1ced8aa..3188c33 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1043,9 +1043,13 @@ _mesa_texstore_z32(TEXSTORE_PARAMS)
          for (row = 0; row < srcHeight; row++) {
             const GLvoid *src = _mesa_image_address(dims, srcPacking,
                 srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0);
+            /* Javantea: I'm doing something silly again.
+           FIXME: Undo with extreme prejudice.
+           Complete fixes the performance problem in Psychonauts
+           No known issues.
             _mesa_unpack_depth_span(ctx, srcWidth,
                                     dstType, dstRow,
-                                    depthScale, srcType, src, srcPacking);
+                                    depthScale, srcType, src, srcPacking);*/
             dstRow += dstRowStride;
          }
       }

The stack trace for what is calling these functions are:
#0  0xf5ae1bf9 in unpack_uint_z_X8_Z24 () from /opt/xorg/lib32/dri/libdricore.so
#1  0xf5ae1eeb in _mesa_unpack_uint_z_row () from /opt/xorg/lib32/dri/libdricore.so
#2  0xf5b2a1a1 in fast_read_depth_pixels () from /opt/xorg/lib32/dri/libdricore.so
#3  0xf5b2a274 in read_depth_pixels () from /opt/xorg/lib32/dri/libdricore.so
#4  0xf5b2b70a in _mesa_readpixels () from /opt/xorg/lib32/dri/libdricore.so
#5  0xf5d5ff70 in intelReadPixels () from /opt/xorg/lib32/dri//i965_dri.so
#6  0xf5b2bbc9 in _mesa_ReadnPixelsARB () from /opt/xorg/lib32/dri/libdricore.so
#7  0xf5b2bc22 in _mesa_ReadPixels () from /opt/xorg/lib32/dri/libdricore.so
#8  0xf5c6d307 in _mesa_meta_BlitFramebuffer () from /opt/xorg/lib32/dri/libdricore.so
#9  0xf5d579a4 in intel_blit_framebuffer () from /opt/xorg/lib32/dri//i965_dri.so
#10 0xf5ac78fb in _mesa_BlitFramebufferEXT () from /opt/xorg/lib32/dri/libdricore.so
#11 0x08187c6e in EOpenGLRenderer::glBlitFramebufferEXT(int, int, int, int, int, int, int, int, unsigned int, unsigned int) const ()
#12 0x0818aa66 in ERenderer::RestoreRenderTarget() ()
#13 0x082f543a in GameApp::CreateDownsampledZBuffer() ()
#14 0x082f395d in GameApp::RenderSceneGeometry() ()
#15 0x082d898e in GameApp::RenderFrame() ()
#16 0x08522ad8 in main ()

and

#0  0xf5adf65d in _mesa_unpack_depth_span () from /opt/xorg/lib32/dri/libdricore.so
#1  0xf5b1aa05 in _mesa_texstore_x8_z24 () from /opt/xorg/lib32/dri/libdricore.so
#2  0xf5b2198d in _mesa_texstore () from /opt/xorg/lib32/dri/libdricore.so
#3  0xf5b21cd6 in store_texsubimage () from /opt/xorg/lib32/dri/libdricore.so
#4  0xf5b21e59 in _mesa_store_teximage () from /opt/xorg/lib32/dri/libdricore.so
#5  0xf5d20b85 in intelTexImage () from /opt/xorg/lib32/dri//i965_dri.so
#6  0xf5b0dd2d in teximage () from /opt/xorg/lib32/dri/libdricore.so
#7  0xf5b0def5 in _mesa_TexImage2D () from /opt/xorg/lib32/dri/libdricore.so
#8  0xf5c2bc56 in setup_drawpix_texture () from /opt/xorg/lib32/dri/libdricore.so
#9  0xf5c2c9b2 in _mesa_meta_BlitFramebuffer () from /opt/xorg/lib32/dri/libdricore.so
#10 0xf5d167fe in intel_blit_framebuffer () from /opt/xorg/lib32/dri//i965_dri.so
#11 0xf5a877bf in _mesa_BlitFramebufferEXT () from /opt/xorg/lib32/dri/libdricore.so
#12 0x08187c6e in EOpenGLRenderer::glBlitFramebufferEXT(int, int, int, int, int, int, int, int, unsigned int, unsigned int) const ()
#13 0x0818aa66 in ERenderer::RestoreRenderTarget() ()
#14 0x0818a364 in ERenderer::SetRenderTarget(unsigned int, unsigned int, CUBEMAPFACE) ()
#15 0x082f4554 in GameApp::BlitTextureFiltered(unsigned int, unsigned int, BLENDMODE, FILTERTYPE, EVec2 const*, EVec2 const*, EVec4 const*, ERect*) ()
#16 0x082ef784 in GameApp::renderGlareToTexture() ()
#17 0x082f3b66 in GameApp::RenderSceneGeometry() ()
#18 0x082d898e in GameApp::RenderFrame() ()
#19 0x08522ad8 in main ()

These stack traces are from 0.2, but since there are symbols it should be possible to use these. It's also very easy to reproduce with Intel drivers (possibly Radeon open source or Nouveau as well).

I'm happy to test a patch or give you any other data or stack traces if you like to fix this. Linux gamers with Intel GPUs should have the excellent experience that I have had with this game.

Btw with IvyBridge, I get good FPS at the highest resolution and highest quality.

Regards,
Javantea

-----Original Message-----
Subject: [psychonauts] Expected performance on Intel Sandybridge?
From: Jeremy Fitzhardinge <jeremy at goop.org>
To: psychonauts at icculus.org
Date: Thu, 21 Jun 2012 21:18:14 -0700

text/plain
Hi,

I'm getting 
17.  This is definitely not a high powered gaming machine, but a lot of
things work surprisingly well on it, including things of a similar era
to Psychonauts (doom3-demo runs at 40-60fps, for example, and the rest
of the HB V games are working well).

Is this something that could be fixed by tweaking settings (I've turned
everything off in the menu, but perhaps there are other settings?) or
optimisation/driver issue that is likely to be fixed in time, or is
there something fundimental about how it does rendering that makes it
unlikely it will ever run well on this machine?

Thanks,
    J
_______________________________________________
psychonauts mailing list
psychonauts at icculus.org
http://icculus.org/mailman/listinfo/psychonauts




More information about the psychonauts mailing list