[Mesa-dev] [PATCH 0/9] Elminate redudnant Mesa IR references

Marcin Slusarz marcin.slusarz at gmail.com
Sun Oct 9 07:41:43 PDT 2011


On Tue, Oct 04, 2011 at 01:44:03PM -0700, Ian Romanick wrote:
> This is the next in my series of internal shader API cleaning.  The
> primary purpose of this series is to remove the extra tracking of Mesa
> IR shaders.  The gl_shader_program has a reference to the Mesa IR
> shader for each stage, and the entry in gl_shader_program::_LinkedShaders
> has a reference to the same Mesa IR.
> 
> The first three patches eliminate the extra references, and the
> remaining six implement some refactors and clean-ups enabled by the
> first three.
> 
>  src/glsl/ir.cpp                                |    8 ---
>  src/glsl/ir.h                                  |    8 ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp           |    8 ++-
>  src/mesa/drivers/dri/i965/brw_fs.h             |    3 +-
>  src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp |    3 +-
>  src/mesa/drivers/dri/i965/brw_vs.c             |    8 ++-
>  src/mesa/drivers/dri/i965/brw_wm.c             |    2 +-
>  src/mesa/main/context.c                        |    8 +--
>  src/mesa/main/ff_fragment_shader.cpp           |   10 ++--
>  src/mesa/main/mtypes.h                         |    3 -
>  src/mesa/main/shaderapi.c                      |   32 +++++------
>  src/mesa/main/shaderobj.c                      |    4 -
>  src/mesa/main/state.c                          |   18 ++++--
>  src/mesa/main/texstate.c                       |   18 +++---
>  src/mesa/main/uniforms.c                       |   42 +++++++++-----
>  src/mesa/program/ir_to_mesa.cpp                |   37 ++++--------
>  src/mesa/program/prog_uniform.c                |   74 ------------------------
>  src/mesa/program/prog_uniform.h                |    4 -
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp     |   44 ++++-----------
>  src/mesa/state_tracker/st_program.c            |    9 +--
>  20 files changed, 111 insertions(+), 232 deletions(-)
> 

Commits 1-5 are unbuildable and one of them introduces crashes in many
piglit tests on nv50, e.g. glx-shader-sharing, glsl-bindattriblocation.

glx-shader-sharing:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff37b1dac in destroy_shader_program_variants_cb (userData=<optimized out>, data=<optimized out>, key=<optimized out>) at state_tracker/st_program.c:1157
warning: Source file is more recent than executable.
1157                                      shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program);
(gdb) bt
#0  0x00007ffff37b1dac in destroy_shader_program_variants_cb (userData=<optimized out>, data=<optimized out>, key=<optimized out>) at state_tracker/st_program.c:1157
#1  destroy_shader_program_variants_cb (key=<optimized out>, data=0x8e9ca0, userData=0x759320) at state_tracker/st_program.c:1141
#2  0x00007ffff3735732 in _mesa_HashWalk (table=0x72fd70, callback=0x7ffff37b1d10 <destroy_shader_program_variants_cb>, userData=0x759320) at main/hash.c:334
#3  0x00007ffff37ac84a in st_destroy_context (st=0x759320) at state_tracker/st_context.c:256
#4  0x00007ffff3643f2d in dri_destroy_context (cPriv=<optimized out>) at dri_context.c:130
#5  0x00007ffff363fab0 in driDestroyContext (pcp=0x6b7330) at ../common/dri_util.c:589
#6  0x00007ffff7bc1575 in dri2_destroy_context () from /usr/lib64/opengl/xorg-x11/lib/libGL.so.1
#7  0x00007ffff7b9b9dc in glXMakeCurrentReadSGI () from /usr/lib64/opengl/xorg-x11/lib/libGL.so.1
#8  0x000000000042c1c8 in draw (dpy=0x66e010) at /data1/gfx/piglit/tests/glx/glx-shader-sharing.c:136
#9  0x000000000042fbe0 in piglit_glx_event_loop (dpy=0x66e010, draw=0x42bec9 <draw>) at /data1/gfx/piglit/tests/util/piglit-glx-util.c:159
#10 0x000000000042c468 in main (argc=2, argv=0x7fffffffd6d8) at /data1/gfx/piglit/tests/glx/glx-shader-sharing.c:192

glsl-bindattriblocation:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff37b1dac in destroy_shader_program_variants_cb (userData=<optimized out>, data=<optimized out>, key=<optimized out>) at state_tracker/st_program.c:1157
warning: Source file is more recent than executable.
1157                                      shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program);
(gdb) bt
#0  0x00007ffff37b1dac in destroy_shader_program_variants_cb (userData=<optimized out>, data=<optimized out>, key=<optimized out>) at state_tracker/st_program.c:1157
#1  destroy_shader_program_variants_cb (key=<optimized out>, data=0x765db0, userData=0x75a6f0) at state_tracker/st_program.c:1141
#2  0x00007ffff3735732 in _mesa_HashWalk (table=0x7312f0, callback=0x7ffff37b1d10 <destroy_shader_program_variants_cb>, userData=0x75a6f0) at main/hash.c:334
#3  0x00007ffff37ac84a in st_destroy_context (st=0x75a6f0) at state_tracker/st_context.c:256
#4  0x00007ffff3643f2d in dri_destroy_context (cPriv=<optimized out>) at dri_context.c:130
#5  0x00007ffff363fab0 in driDestroyContext (pcp=0x67e8c0) at ../common/dri_util.c:589
#6  0x00007ffff7bc1575 in dri2_destroy_context () from /usr/lib64/opengl/xorg-x11/lib/libGL.so.1
#7  0x00007ffff76e95cb in __glutDestroyWindow (window=0x67bd80, initialWindow=0x67bd80) at glut_win.c:831
#8  0x00007ffff76e979c in glutDestroyWindow (win=<optimized out>) at glut_win.c:882
#9  0x000000000042d6aa in display () at /data1/gfx/piglit/tests/util/piglit-framework.c:51
#10 0x00007ffff76de92b in processWindowWorkList (window=0x67bd80) at glut_event.c:1307
#11 0x00007ffff76df82c in __glutProcessWindowWorkLists () at glut_event.c:1358
#12 glutMainLoop () at glut_event.c:1379
#13 0x000000000042d82b in main (argc=1, argv=0x7fffffffd6d8) at /data1/gfx/piglit/tests/util/piglit-framework.c:116


More information about the mesa-dev mailing list