Bug 26123

Summary: Rendering to offscreen depth-texture fails
Product: Mesa Reporter: Pavel Rojtberg <pavel>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: MostAwesomedude
Version: git   
Hardware: Other   
OS: All   
URL: http://fabiensanglard.net/shadowmapping/index.php
Whiteboard:
i915 platform: i915 features:
Attachments: rendering errors with shadowmap
Failed shadowmap CS

Description Pavel Rojtberg 2010-01-19 15:20:05 UTC
driver: r300g, latest git on ubuntu lucid. (Kernel 2.6.32)

when executing the linked demo, the shadowmap is being misrendered and on the console there is a lot of vomit in the style of:

Pkt3 at 306 :
    PACKET3_3D_LOAD_VBPNTR:
        0x00000001
        0x00000603
        0x000004B0
Pkt3 at 310 :
    PACKET3_NOP:
        0x00000004
Pkt0 at 312 (1 dwords):
    0x0003AAAA -> 0x4278
Pkt0 at 314 (1 dwords):
    0x00000000 -> 0x2138
Pkt0 at 316 (1 dwords):
    0x00000017 -> 0x2134
Pkt3 at 318 :
    PACKET3_3D_DRAW_VBUF_2:
        0x0018002D
...

If I change the code and add a COLOR_ATTACHMENT texture to the FBO the vomit goes away, but the shadowmap is still misrendered.
Comment 1 Corbin Simpson 2010-03-19 16:36:57 UTC
Try again with current git?
Comment 2 Pavel Rojtberg 2010-03-20 04:08:55 UTC
Created attachment 34252 [details]
rendering errors with shadowmap
Comment 3 Pavel Rojtberg 2010-03-20 04:09:24 UTC
the vomit went away when the drm in lucid was updated to 2.6.33. With the current mesa git the shadowmap is rendered correctly, but the final picture is still misrendered. (see screenshot)
Comment 4 Corbin Simpson 2010-03-26 06:12:55 UTC
Created attachment 34478 [details]
Failed shadowmap CS
Comment 5 Marek Olšák 2010-04-11 19:55:17 UTC
The demo more or less works here with latest kernel and libdrm (2.6.32 is too old), but I think Mesa doesn't like the way shadow samplers are used here as it fails with gallium/softpipe too. I am changing the component to Mesa core.

In the meantime, please use the sampler type sampler2DShadow and the fetching function shadow2D. That should work.
Comment 6 Marek Olšák 2010-09-14 11:26:01 UTC
Pavel, could you please test latest Mesa master?
Comment 7 Pavel Rojtberg 2010-09-14 15:21:47 UTC
works fine now. mesa git on Ubuntu Maverick.

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.