Bug 73638 - [llvmpipe] piglit fbo-missing-attachment-blit es2 from regression
Summary: [llvmpipe] piglit fbo-missing-attachment-blit es2 from regression
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-01-15 01:41 UTC by Vinson Lee
Modified: 2014-01-20 20:39 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2014-01-15 01:41:44 UTC
mesa: 8c4a9f631d7438aeaf56785401891d0773792123 (master)

$ ./bin/fbo-missing-attachment-blit es2 from -auto
Testing blit from buffer with missing attachment to complete buffer...
Segmentation fault (core dumped)

Program terminated with signal 11, Segmentation fault.
#0  0x00007f6e6757cd1c in lp_scene_begin_binning (scene=0x7f6e6b1e0010, fb=0x191a998, discard=0 '\000') at src/gallium/drivers/llvmpipe/lp_scene.c:524
524	      if (llvmpipe_resource_is_texture(cbuf->texture)) {
(gdb) bt
#0  0x00007f6e6757cd1c in lp_scene_begin_binning (scene=0x7f6e6b1e0010, fb=0x191a998, discard=0 '\000') at src/gallium/drivers/llvmpipe/lp_scene.c:524
#1  0x00007f6e6757e1ed in lp_setup_get_empty_scene (setup=0x191a820) at src/gallium/drivers/llvmpipe/lp_setup.c:84
#2  0x00007f6e6757e964 in set_scene_state (setup=0x191a820, new_state=SETUP_CLEARED, reason=0x7f6e68384cb0 <__func__.16142> "lp_setup_try_clear")
    at src/gallium/drivers/llvmpipe/lp_setup.c:290
#3  0x00007f6e6757ed7b in lp_setup_try_clear (setup=0x191a820, color=0x7f6e5dc404ec, depth=0, stencil=0, flags=1) at src/gallium/drivers/llvmpipe/lp_setup.c:434
#4  0x00007f6e6757ee5c in lp_setup_clear (setup=0x191a820, color=0x7f6e5dc404ec, depth=0, stencil=0, flags=1) at src/gallium/drivers/llvmpipe/lp_setup.c:461
#5  0x00007f6e675a400f in llvmpipe_clear (pipe=0x19038b0, buffers=1, color=0x7f6e5dc404ec, depth=0, stencil=0) at src/gallium/drivers/llvmpipe/lp_clear.c:62
#6  0x00007f6e677e6a6a in st_Clear (ctx=0x7f6e5dc3f010, mask=16) at src/mesa/state_tracker/st_cb_clear.c:512
#7  0x00007f6e677413d4 in _mesa_Clear (mask=256) at src/mesa/main/clear.c:206
#8  0x00007f6e6ae762cf in stub_glClear (mask=256) at piglit/tests/util/generated_dispatch.c:1935
#9  0x00000000004015ef in do_blit_test (use_es2=true, from_missing_to_complete=true) at piglit/tests/spec/arb_es2_compatibility/fbo-missing-attachment-blit.c:143
#10 0x00000000004018fc in piglit_init (argc=3, argv=0x7fffbad52918) at piglit/tests/spec/arb_es2_compatibility/fbo-missing-attachment-blit.c:214
#11 0x00007f6e6ae718fa in run_test (gl_fw=0x7f6e6b15f340 <glut_fw>, argc=3, argv=0x7fffbad52918) at piglit/tests/util/piglit-framework-gl/piglit_glut_framework.c:140
#12 0x00007f6e6ae6f6c9 in piglit_gl_test_run (argc=3, argv=0x7fffbad52918, config=0x7fffbad527e0) at piglit/tests/util/piglit-framework-gl.c:191
#13 0x000000000040133e in main (argc=3, argv=0x7fffbad52918) at piglit/tests/spec/arb_es2_compatibility/fbo-missing-attachment-blit.c:67
(gdb) frame 0
#0  0x00007f6e6757cd1c in lp_scene_begin_binning (scene=0x7f6e6b1e0010, fb=0x191a998, discard=0 '\000') at src/gallium/drivers/llvmpipe/lp_scene.c:524
524	      if (llvmpipe_resource_is_texture(cbuf->texture)) {
(gdb) print cbuf
$1 = (struct pipe_surface *) 0x0


9baa45f78b8ca7d66280e36009b6a685055d7cd6 is the first bad commit
commit 9baa45f78b8ca7d66280e36009b6a685055d7cd6
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Wed Jan 8 01:09:15 2014 +0100

    st/mesa: bind NULL colorbuffers as specified by glDrawBuffers
    
    An example why it is required:
    
        Let's say there's a fragment shader writing to gl_FragData[0..1].
        The user calls: glDrawBuffers(2, {GL_NONE, GL_COLOR_ATTACHMENT0});
    
        That means gl_FragData[0] is unused and gl_FragData[1] is written
        to GL_COLOR_ATTACHMENT0.
    
    st/mesa was skipping the GL_NONE draw buffer, therefore gl_FragData[0]
    was written to GL_COLOR_ATTACHMENT0, which was wrong.
    
    This commit fixes it, but drivers must also be fixed not to crash when
    binding NULL colorbuffers. There is also a new set of piglit tests for this.
    
    The MSAA state also had to be fixed not to crash when reading fb->cbufs[0].
    
    Reviewed-by: Brian Paul <brianp@vmware.com>

:040000 040000 6818bdd84e475c30bd43fc3b5d98af8c6cdd39a7 e73a34aacda41dd8046b425b6d2397a1f8dd6ee8 M	src
bisect run success
Comment 1 Vinson Lee 2014-01-20 20:39:27 UTC
commit d6fa71fbb0d365cefdabfea9de62cfece71f7486
Author: Brian Paul <brianp@vmware.com>
Date:   Wed Jan 15 18:09:56 2014 -0800

    llvmpipe: handle NULL color buffer pointers
    
    Fixes regression from 9baa45f78b8ca7d66280e36009b6a685055d7cd6
    
    v2: incorporate a few small changes suggested by Roland.
    
    Reviewed-by: José Fonseca <jfonseca@vmware.com>
    Reviewed-by: Roland Scheidegger <sroland@vmware.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.