mesa/src
Kenneth Graunke 57a502518e i965: Fix INTEL_DEBUG=shader_time for fragment shaders with discards.
"discard" instructions generate HALT instructions which jump to a final
HALT near the end of the shader.  Previously, fs_generator created this
final jump target when it saw the first FS_OPCODE_FB_WRITE, causing it
to jump right before the FB write epilogue.  This is normally good.

However, INTEL_DEBUG=shader_time also has an epilogue section which
records the final timestamp.  The frontend emits IR for this just before
FS_OPCODE_FB_WRITE.  Unfortunately, this led to the following ordering:

1. Shader Time Epilogue
2. Final HALT (where discards jump)
3. Framebuffer Write Epilogue

This meant that discarded pixels completely skipped the shader time
epilogue, causing no ending timestamp to be written.  This obviously
led to inaccurate results.

This patch adds a new FS_OPCODE_PLACEHOLDER_HALT in the IR stream just
before any epilogue sections.  This is where the final HALT should be
generated, and makes it easy to ensure the correct ordering:

1. Final HALT
2. Shader Time Epilogue
3. Framebuffer Write Epilogue

For shaders that don't discard, this opcode compiles away to nothing.
The scheduler adds barrier dependencies to make sure that it doesn't
get moved above any FS_OPCODE_DISCARD_JUMP instructions.

One 8-wide shader in GLBenchmark 2.7 dropped from 2291.67 Gcycles to
a mere 5.13 Gcycles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-03-29 11:39:32 -07:00
..
egl egl_dri2: Lower __DRI_IMAGE version requirement back to 1 2013-03-19 16:13:38 -04:00
gallium gallivm: consolidate some half-to-float and r11g11b10-to-float code 2013-03-29 16:39:40 +01:00
gbm gbm: Remember to init format on gbm_dri_bo_create. 2013-02-07 20:00:52 -05:00
getopt
glsl glsl: Implement ARB_texture_query_lod 2013-03-29 10:20:26 -07:00
glx glx: Build with VISIBILITY_CFLAGS in automake 2013-03-21 13:21:18 -04:00
gtest gtest: Build it only for 'make check'. 2013-01-13 12:38:44 +01:00
mapi gles2: Add an ABI-check test 2013-03-19 12:04:32 -07:00
mesa i965: Fix INTEL_DEBUG=shader_time for fragment shaders with discards. 2013-03-29 11:39:32 -07:00
Makefile.am
SConscript Remove libGLU 2012-08-31 10:58:15 -07:00